getInfo($order_condition); if (empty($info)) return $this->error(); $stat_data = array ( 'site_id' => $site_id, 'coupon_count' => 1 ); $member_id = $info[ 'member_id' ]; //如果是第一笔订单才能累加下单会员数 $time_region = getDayStartAndEndTime(); $today_start_time = $time_region[ 'start_time' ]; $today_end_time = $time_region[ 'end_time' ]; $today_order_condition = array ( [ 'member_id', '=', $member_id ], [ 'fetch_time', 'between', [ $today_start_time, $today_end_time ] ], [ 'coupon_id', '<>', $coupon_id ] ); $count = model('promotion_coupon')->getCount($today_order_condition); if ($count == 0) { $stat_data[ 'coupon_member_count' ] = 1; } $stat_model = new Stat(); $result = $stat_model->addShopStat($stat_data); return $result; } }