shish 1 год назад
Родитель
Сommit
0b701c7405
1 измененных файлов с 49 добавлено и 0 удалено
  1. 49 0
      console/controllers/LsCustomController.php

+ 49 - 0
console/controllers/LsCustomController.php

@@ -0,0 +1,49 @@
+<?php
+
+namespace console\controllers;
+
+use bizHd\custom\classes\CustomClass;
+use bizHd\custom\classes\HdClass;
+use bizHd\custom\models\Custom;
+use bizHd\shop\models\Shop;
+use yii\console\Controller;
+use Yii;
+
+class LsCustomController extends Controller
+{
+
+
+    public function actionIndex()
+    {
+        //先确认所有客户的欠款总数跟账单总和能不能对应上 ssh 20250620
+        //批发不需要这一步
+        //零售要去数据库确认这一步
+    }
+
+    public function actionMigrate()
+    {
+
+        $query = new \yii\db\Query();
+        $query->from(Shop::tableName());
+        $query->where(['ptStyle' => 1]);
+        $query->orderBy('addTime ASC');
+        foreach ($query->batch(20) as $shopList) {
+            foreach ($shopList as $shop) {
+                $shopId = $shop['id']??0;
+
+                $query = new \yii\db\Query();
+                $query->from(Custom::tableName());
+                $query->where(['shopId' => $shopId]);
+                $query->orderBy('addTime ASC');
+                foreach ($query->batch(50) as $customList) {
+                    foreach ($customList as $custom) {
+
+                    }
+                }
+
+
+            }
+        }
+    }
+
+}