|
|
@@ -407,4 +407,26 @@ class OrderItemClass extends BaseClass
|
|
|
return $respond;
|
|
|
}
|
|
|
|
|
|
+ public static function refreshBelongCost()
|
|
|
+ {
|
|
|
+ $customerCachedKey = 'change_belong_cost_item_list';
|
|
|
+ $belongList = [];
|
|
|
+ while ($count = Yii::$app->redis->executeCommand('LLEN', [$customerCachedKey])) {
|
|
|
+ $string = Yii::$app->redis->executeCommand('RPOP', [$customerCachedKey]);
|
|
|
+ $arr = explode('_', $string);
|
|
|
+ if (count($arr) == 2) {
|
|
|
+ $belongList[] = ['id' => $arr[0], 'belongCost' => $arr[1]];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (empty($belongList)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ foreach ($belongList as $info) {
|
|
|
+ $id = $info['id'];
|
|
|
+ $belongCost = $info['belongCost'];
|
|
|
+ noticeUtil::push('变更花材的成本和收入' . $id . ' ' . $belongCost, '15280215347');
|
|
|
+ self::updateByCondition(['belongCost' => $id, 'belongCost' => $belongCost]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|