shish пре 5 месеци
родитељ
комит
f589aafccd
1 измењених фајлова са 21 додато и 0 уклоњено
  1. 21 0
      console/controllers/TestController.php

+ 21 - 0
console/controllers/TestController.php

@@ -38,6 +38,27 @@ use yii\console\Controller;
 class TestController extends Controller
 {
 
+    public function actionStaff()
+    {
+        ini_set('memory_limit', '2045M');
+        set_time_limit(0);
+        $shopList = ShopClass::getAllByCondition(['ptStyle' => 2], null, 'id,mainId', null, true);
+        if (!empty($shopList)) {
+            foreach ($shopList as $shop) {
+                $mainId = $shop->mainId;
+                $staffList = StaffClass::getAllByCondition(['mainId' => $mainId], null, 'id,adminId,mobile', null, true);
+                if (!empty($staffList)) {
+                    foreach ($staffList as $staff) {
+                        echo $staff->id;die;
+                        $adminId = $staff->adminId;
+                        $mobile = $staff->mobile;
+                        AdminClass::updateById($adminId, ['mobile' => $mobile]);
+                    }
+                }
+            }
+        }
+    }
+
     public function actionCustomBuyAmount()
     {
         ini_set('memory_limit', '2045M');