作者 chencheng

0601-23

@@ -186,9 +186,22 @@ class Client extends Base @@ -186,9 +186,22 @@ class Client extends Base
186 $receive=Db::name('verification_receive') 186 $receive=Db::name('verification_receive')
187 ->alias('a') 187 ->alias('a')
188 ->join('verification_coupon b','a.verification_coupon_id=b.id') 188 ->join('verification_coupon b','a.verification_coupon_id=b.id')
189 - ->field("a.id,b.name,b.type,b.voucher_amount,b.gift,b.consumption,b.reduction,b.consumption_name,b.image,DATE_FORMAT(FROM_UNIXTIME(b.closetime), '%Y-%m-%d') AS closetime") 189 + ->field("a.id,b.name,a.type,
  190 + b.type as verification_coupon_type,
  191 + b.closetime,b.voucher_amount,b.gift,b.consumption,b.reduction,b.consumption_name,b.image,DATE_FORMAT(FROM_UNIXTIME(b.closetime), '%Y-%m-%d') AS closetime")
190 ->where($receivewhere)->select(); 192 ->where($receivewhere)->select();
191 193
  194 + $time = time();
  195 + if(!empty($receive)){
  196 + //过期检测
  197 + foreach($receive as $k=>&$v){
  198 + //已过期
  199 + if(strtotime($v['closetime']." 23:59:59") < $time){
  200 + Db::name('verification_receive')->where(['id'=>$v['id']])->update(['type'=>'2']);
  201 + $v['type'] = '2';
  202 + }
  203 + }
  204 + }
192 $order['receive']=$receive; 205 $order['receive']=$receive;
193 foreach ($order['receive'] as $key => $value) { 206 foreach ($order['receive'] as $key => $value) {
194 if($order['receive'][$key]['image']){ 207 if($order['receive'][$key]['image']){