示例#1
0
 /**
  * 
  * 批量从银联下载优惠券,只有第一次和银联绑定成功(绑卡后)才会异步调用一次
  */
 public function batchDownloadUnionCoupon_get()
 {
     $uid = $this->get('uid');
     $query = $this->db->query("select A.couponId as id, A.transSeq, B.username mobile, B.unionId, C.unionCouponId\nfrom downloadedcoupon A\nleft join user B\non A.uid=B.id\nleft join coupon C\non C.id=A.couponId\nwhere B.id={$uid}");
     $coupons = $query->result_array();
     if (!empty($coupons)) {
         $coupon = $coupons[0];
         $mobile = $coupon['mobile'];
         $unionUid = $coupon['unionId'];
         $this->kqlibrary->download_batch_coupons($uid, $mobile, $unionUid, $coupons);
     }
 }
示例#2
0
 /**
  * 
  * 批量从银联下载优惠券,只有第一次和银联绑定成功(绑卡后)才会异步调用一次
  */
 public function batchDownloadUnionCoupon_get()
 {
     $uid = $this->get('uid');
     // 用户下载并且没过期的优惠券
     $query = $this->db->query("select A.couponId as id, A.transSeq, B.username mobile, B.unionId, C.unionCouponId\n\t\tfrom downloadedcoupon A\n\t\tleft join user B\n\t\ton A.uid=B.id\n\t\tleft join coupon C\n\t\ton C.id=A.couponId\n\t\twhere B.id={$uid}\n\t\tAND `C`.`endDate` > now()");
     $coupons = $query->result_array();
     if (!empty($coupons)) {
         $coupon = $coupons[0];
         $mobile = $coupon['mobile'];
         $unionUid = $coupon['unionId'];
         $response = $this->kqlibrary->download_batch_coupons($uid, $mobile, $unionUid, $coupons);
         //记录批量下载的结果
         log_message('error', "Batch Download Coupon Response # {$response}");
     }
 }