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


PHP CService::factory方法代码示例

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


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

示例1: bind

 public function bind($mobile, $no, $name)
 {
     $members = CService::factory("Member")->queryMemberAnd($mobile, $no, $name);
     if (empty($members)) {
         $this->setError("can not find this member!");
         return array(-1, null);
     }
     $arr = array();
     foreach ($members as $key => $value) {
         $cards = D("Card")->getAllCards($value['id']);
         foreach ($cards as $card) {
             $info = array("card_id" => $card['card_number']);
             $club_id = "";
             $clubs = array();
             $contracts = D("Contract")->getAllContract($card['id']);
             foreach ($contracts as $contract) {
                 $clbs = D("CardUseclub")->getAllUseClub($contract['card_type_id']);
                 foreach ($clbs as $clb) {
                     $clubs[] = $clb['id'];
                 }
             }
             $clubs = array_unique($clubs);
             $club_id = implode(',', $clubs);
             $info['club_id'] = $club_id;
             $arr[] = $info;
         }
     }
     return array(0, $arr);
 }
开发者ID:peterleezz,项目名称:test,代码行数:29,代码来源:ApiService.class.php

示例2: queryPayBack

 public function queryPayBack($clubs, $start_time, $end_time, $sidx, $limit, $sord, $start)
 {
     $condition = array("ret" => 0, "club_id" => array("in", $clubs));
     if (!empty($start_time) && !empty($end_time)) {
         $condition["create_time"] = array("between", "{$start_time},{$end_time}");
     } else {
         if (!empty($start_time)) {
             $condition["create_time"] = array("gt", "{$start_time}");
         } else {
             if (!empty($end_time)) {
                 $condition["create_time"] = array("lt", "{$end_time}");
             }
         }
     }
     $model = D("PayBack");
     $objects = $model->relation(true)->where($condition)->order("{$sidx} {$sord}")->limit("{$start},{$limit}")->select();
     $count = $model->where($condition)->count();
     foreach ($objects as $key => $value) {
         $objects[$key]['bill'] = CService::factory("Financial")->getBillProject("0,3,4,5", $value['contract_id']);
     }
     return array($count, $objects);
 }
开发者ID:peterleezz,项目名称:test,代码行数:22,代码来源:MemberService.class.php


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