shish 1 年間 前
コミット
9415c55806
1 ファイル変更26 行追加0 行削除
  1. 26 0
      app-ghs/controllers/LiveOrderController.php

+ 26 - 0
app-ghs/controllers/LiveOrderController.php

@@ -14,6 +14,32 @@ use Yii;
 class LiveOrderController extends BaseController
 {
 
+    //转换成订单 ssh 20241006
+    public function actionConvertOrder()
+    {
+        $mainId = $this->mainId;
+        $cacheKey = 'live_order_' . $mainId;
+        $has = Yii::$app->redis->executeCommand('GET', [$cacheKey]);
+        if (!empty($has)) {
+            util::fail('已经在转换了');
+        }
+        $list = LiveOrderClass::getAllByCondition(['mainId' => $mainId], null, '*', null, true);
+        if (empty($list)) {
+            util::fail('没有记录需要转换');
+        }
+        $arr = [];
+        foreach ($list as $live) {
+            $addTime = $live->addTime;
+            $date = date("Y-m-d", strtotime($addTime));
+            $arr[$date] = 1;
+        }
+        if (count($arr) > 1) {
+            util::fail('有记录不是同一天的');
+        }
+        Yii::$app->redis->executeCommand('SETEX', [$cacheKey, 180, 1]);
+        util::success('提交成功,3分钟后查看订单');
+    }
+
     //走播单列表 ssh 20241003
     public function actionList()
     {