songxingwei %!s(int64=2) %!d(string=hai) anos
pai
achega
b954274bd6
Modificáronse 1 ficheiros con 13 adicións e 0 borrados
  1. 13 0
      application/api/controller/Timedtask.php

+ 13 - 0
application/api/controller/Timedtask.php

@@ -79,6 +79,19 @@ class Timedtask
                 $info['status'] = 2;
                 $info['cancel_at'] = date('Y-m-d H:i:s');
                 Db::name('store_order_info_order')->where('id',$v['id'])->update($info);
+
+                $cancle = [
+                    'mid'=>$v['mid'],
+                    'order_id'=>$v['id']
+                ];
+                Db::name('store_order_info_cancel_log')->insert($cancle);
+
+                $time = date('Y-m-d H:i:s',time()-(60*60));
+                $count = Db::name('store_order_info_cancel_log')->where('mid',$v['mid'])->where('create_at','gt',$time)->count();
+                if ($count>2){
+                    $buy_time = date('Y-m-d H:i:s',time()+(24*60*60));
+                    Db::name('store_member')->where('id',$v['mid'])->update(['buy_time'=>$buy_time]);
+                }
             }
         }
     }