Kirin 3 years ago
parent
commit
51b8d58721
1 changed files with 4 additions and 9 deletions
  1. 4 9
      app/api/controller/PublicController.php

+ 4 - 9
app/api/controller/PublicController.php

@@ -40,18 +40,13 @@ class PublicController
 
 
     public function test()
     public function test()
     {
     {
-//        var_dump(111);
-        $order = StoreOrder::where('transaction_id', 'not null')->where('refund_status', 0)->where('is_del', 0)->where('is_system_del', 0)->where('status', '>', 1)->select();
-        var_dump(count($order));
         try {
         try {
-            foreach ($order as $v) {
-                $res = MiniProgramService::profit_sharing_finish($v['transaction_id'], 'over_' . $v['order_id']);
-//                $res = MiniProgramService::profit_sharing_query($v['transaction_id'], $v['order_id']);
-                var_dump($res);
-//                exit;
-            }
+            Db::startTrans();
+            StoreOrder::startTakeOrder();//7天自动收货
+            Db::commit();
         } catch (\Exception $e) {
         } catch (\Exception $e) {
             var_dump($e->getMessage());
             var_dump($e->getMessage());
+            Db::rollback();
         }
         }
     }
     }