Bladeren bron

Merge branch 'master' into dev

shish 2 maanden geleden
bovenliggende
commit
22cc9b672d
2 gewijzigde bestanden met toevoegingen van 38 en 1 verwijderingen
  1. 2 1
      app-ghs/controllers/TestController.php
  2. 36 0
      console/controllers/ClearController.php

+ 2 - 1
app-ghs/controllers/TestController.php

@@ -503,7 +503,8 @@ class TestController extends BaseController
             //['name' => '昆明洋洋的花', 'merchantNo' => '82273105992012L', 'wx' => [899641357, 899640792], 'zfb' => '2088780116043804'],
             //['name' => '昆明洋洋的花', 'merchantNo' => '82273105992012L', 'wx' => [899641357, 899640792], 'zfb' => '2088780116043804'],
             //['name' => '莆田我要花', 'merchantNo' => '82239405992009K', 'wx' => [900215179, 900215380], 'zfb' => '2088780157526852'],
             //['name' => '莆田我要花', 'merchantNo' => '82239405992009K', 'wx' => [900215179, 900215380], 'zfb' => '2088780157526852'],
             //['name' => '广州福隆花卉', 'merchantNo' => '8225810599201T8', 'wx' => [900532403, 900531348], 'zfb' => '2088780172288658'],
             //['name' => '广州福隆花卉', 'merchantNo' => '8225810599201T8', 'wx' => [900532403, 900531348], 'zfb' => '2088780172288658'],
-            ['name' => '张家口万花汇', 'merchantNo' => '82213805992008D', 'wx' => [901551070, 901551037], 'zfb' => '2088780253600870'],
+            //['name' => '张家口万花汇', 'merchantNo' => '82213805992008D', 'wx' => [901551070, 901551037], 'zfb' => '2088780253600870'],
+            ['name' => '深圳每日鲜花批发', 'merchantNo' => '82258405992020E', 'wx' => [902309136, 902307468], 'zfb' => '2088780298610704'],
             //['name' => '厦门纯彩花艺', 'merchantNo' => '8223930599200LD', 'wx' => [894984230, 894983290], 'zfb' => '2088680439152343'],
             //['name' => '厦门纯彩花艺', 'merchantNo' => '8223930599200LD', 'wx' => [894984230, 894983290], 'zfb' => '2088680439152343'],
             //['name' => '东莞我要花鲜花', 'merchantNo' => '8226020599200R8', 'wx' => [894794554, 894794917], 'zfb' => '2088680405463378'],
             //['name' => '东莞我要花鲜花', 'merchantNo' => '8226020599200R8', 'wx' => [894794554, 894794917], 'zfb' => '2088680405463378'],
             //['name' => '镇江花珩鲜花批发', 'merchantNo' => '82231405992003N', 'wx' => [894925711, 894925626], 'zfb' => '2088680426877183'],
             //['name' => '镇江花珩鲜花批发', 'merchantNo' => '82231405992003N', 'wx' => [894925711, 894925626], 'zfb' => '2088680426877183'],

+ 36 - 0
console/controllers/ClearController.php

@@ -5,6 +5,7 @@ namespace console\controllers;
 use biz\ghs\classes\GhsBackClass;
 use biz\ghs\classes\GhsBackClass;
 use bizGhs\clear\classes\OrderCgClearClass;
 use bizGhs\clear\classes\OrderCgClearClass;
 use bizGhs\clear\models\Clear;
 use bizGhs\clear\models\Clear;
+use bizGhs\clear\models\OrderCgClear;
 use bizGhs\custom\classes\CustomClass;
 use bizGhs\custom\classes\CustomClass;
 use bizGhs\custom\classes\CustomBalanceChangeClass;
 use bizGhs\custom\classes\CustomBalanceChangeClass;
 use bizGhs\ghs\classes\GhsBalanceChangeClass;
 use bizGhs\ghs\classes\GhsBalanceChangeClass;
@@ -20,6 +21,41 @@ use Yii;
 class ClearController extends Controller
 class ClearController extends Controller
 {
 {
 
 
+    public function actionUpdate()
+    {
+        ini_set('memory_limit', '2045M');
+        set_time_limit(0);
+
+        $query = new \yii\db\Query();
+        $query->from(Clear::tableName());
+        //$query->where(['id'=>828832]);
+        $query->orderBy('id desc');
+        foreach ($query->batch(500) as $clearList) {
+            foreach ($clearList as $clear) {
+                $status = $clear['status'] ?? 1;
+                $clearId = $clear['id'] ?? 0;
+                $clearPrice = $clear['actPrice'] ?? 0;
+                $addTime = $clear['addTime'] ?? '';
+                $clearPrice = floatval($clearPrice);
+                if ($status == 2) {
+                    $relateList = OrderCgClearClass::getAllByCondition(['clearId' => $clearId], null, '*');
+                    $count = count($relateList);
+                    if ($count == 1) {
+                        foreach ($relateList as $relate) {
+                            $cgId = $relate['cgId'] ?? 0;
+                            $cgInfo = GhsClass::getById($cgId, true);
+                            $remainDebtPrice = $cgInfo->remainDebtPrice ?? 0;
+                            $remainDebtPrice = floatval($remainDebtPrice);
+                            if ($remainDebtPrice > 0 && $clearPrice == $remainDebtPrice) {
+                                echo "clearId {$clearId} cgId {$cgId} remainDebtPrice {$remainDebtPrice} {$addTime} 需要清除 \n";
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+
     public function actionGhsGhs()
     public function actionGhsGhs()
     {
     {
         ini_set('memory_limit', '2045M');
         ini_set('memory_limit', '2045M');