本文整理汇总了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);
}
示例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);
}