当前位置: 首页>>代码示例>>PHP>>正文


PHP Transfer::setAccount方法代码示例

本文整理汇总了PHP中Transfer::setAccount方法的典型用法代码示例。如果您正苦于以下问题:PHP Transfer::setAccount方法的具体用法?PHP Transfer::setAccount怎么用?PHP Transfer::setAccount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Transfer的用法示例。


在下文中一共展示了Transfer::setAccount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: retrieveByClient

  static public function retrieveByClient($status, $client_id = null)
  {
//echo $status;
    $types= array('all','sell','purchase','switch');
    $statuses= array('all','pending','completed','cancelled');    
    if(!in_array($status,$statuses))
    if(!in_array($status,$types))    
      die('Wrong status when getting transfer collection!');
    $IsTypeOriented = in_array($status,$statuses) ? false: true;
    if(!$client_id)
      die('Should add case for all clients!');


    $transactions= array();
    if($IsTypeOriented)
      $addition = ($status!= 'all') ? " AND types = '$status'" : "";
    else
      $addition = ($status!= 'all') ? " AND status = '$status'" : "";
      
    $query = " SELECT t.id, t.created_at, t.comment, a.name aname, i.fund_name name,
    i.ISIN code, t.status, t.types, t.amount, t.trade_date, t.settlement_date
    FROM transfers t, custody_ac a, fund i
    WHERE t.id_client = '$client_id' AND a.id = t.id_custody1 AND i.id = t.id_isin $addition ";
    
    $qres=mysql_query($query) or die(mysql_error());
    while($row=mysql_fetch_assoc($qres))
    {

      $transfer = new Transfer();
      $transfer->setId($row['id']);
      $transfer->setStatus($row['status']);
      $transfer->setType($row['types']);
      $transfer->setComment($row['comment']);
      $transfer->setSecurity($row['name']);
      $transfer->setAmount($row['amount']);
      $transfer->setIsin($row['code']);
      $transfer->setTradeDate($row['trade_date']);
      $transfer->setSettlementDate($row['settlement_date']);
      $transfer->setAccount($row['aname']);
      $transfer->setCreatedAt($row['created_at']);
      $transfers[] = $transfer;

    }

    return $transfers;
  }
开发者ID:hungnv0789,项目名称:vhtm,代码行数:46,代码来源:transfercollection.class.php


注:本文中的Transfer::setAccount方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。