|
|
@@ -8,6 +8,7 @@ use biz\item\classes\PtItemClass;
|
|
|
use biz\main\classes\MainClass;
|
|
|
use biz\shop\classes\ShopClass;
|
|
|
use biz\sj\classes\SjClass;
|
|
|
+use bizGhs\custom\models\Custom;
|
|
|
use bizGhs\item\classes\ItemClass;
|
|
|
use bizGhs\item\classes\ItemClassClass;
|
|
|
use bizGhs\order\classes\OrderItemClass;
|
|
|
@@ -29,30 +30,39 @@ class TestController extends Controller
|
|
|
{
|
|
|
ini_set('memory_limit', '2045M');
|
|
|
set_time_limit(0);
|
|
|
- $list = \bizGhs\order\classes\OrderClass::getAllByCondition(['payTime>' => '2024-05-01 00:00:00'], 'payTime asc', '*', null, true);
|
|
|
- if (!empty($list)) {
|
|
|
- foreach ($list as $info) {
|
|
|
- $customId = $info->customId ?? 0;
|
|
|
- $ghsId = $info->ghsId ?? 0;
|
|
|
- $custom = \bizGhs\custom\classes\CustomClass::getById($customId, true);
|
|
|
- $payTime = $info->payTime;
|
|
|
- $orderSn = $info->orderSn ?? '';
|
|
|
- if (!empty($custom)) {
|
|
|
- $custom->recentExpend = $payTime;
|
|
|
- $custom->save();
|
|
|
- echo $orderSn . ' ' . $payTime . " custom {$custom->id} ok \n";
|
|
|
- }
|
|
|
- $ghs = \bizGhs\ghs\classes\GhsClass::getById($ghsId, true);
|
|
|
- if (!empty($ghs)) {
|
|
|
- $ghs->recentExpend = $payTime;
|
|
|
- $ghs->save();
|
|
|
- echo $orderSn . ' ' . $payTime . " ghs {$ghs->id} ok \n";
|
|
|
+ $query = new \yii\db\Query();
|
|
|
+ $query->from(Custom::tableName());
|
|
|
+ $query->where(['recentExpend' => '2024-02-01 01:01:00']);
|
|
|
+ $query->orderBy('addTime ASC');
|
|
|
+ foreach ($query->batch(50) as $customList) {
|
|
|
+ if (!empty($customList)) {
|
|
|
+ foreach ($customList as $custom) {
|
|
|
+ $customId = $custom['id'] ?? 0;
|
|
|
+ $order = \bizGhs\order\classes\OrderClass::getByCondition(['customId' => $customId, 'payStatus' => 1,], true, 'payTime DESC');
|
|
|
+ $custom = \bizGhs\custom\classes\CustomClass::getById($customId, true);
|
|
|
+ if (!empty($order)) {
|
|
|
+ $orderSn = $order->ordersn ?? '';
|
|
|
+ $payTime = $order->payTime;
|
|
|
+ if (!empty($custom)) {
|
|
|
+ $custom->recentExpend = $payTime;
|
|
|
+ $custom->save();
|
|
|
+ echo $orderSn . " " . $payTime . " custom {$customId} OK \n";
|
|
|
+ }
|
|
|
+ $ghsId = $custom['ghsId'] ?? 0;
|
|
|
+ $ghs = \bizGhs\ghs\classes\GhsClass::getById($ghsId, true);
|
|
|
+ if (!empty($ghs)) {
|
|
|
+ $ghs->recentExpend = $payTime;
|
|
|
+ $ghs->save();
|
|
|
+ echo $orderSn . " " . $payTime . " ghsId {$ghsId} OK \n";
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public function actionBelong()
|
|
|
+ public
|
|
|
+ function actionBelong()
|
|
|
{
|
|
|
ini_set('memory_limit', '2045M');
|
|
|
set_time_limit(0);
|
|
|
@@ -100,7 +110,8 @@ class TestController extends Controller
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public function actionHdCustom()
|
|
|
+ public
|
|
|
+ function actionHdCustom()
|
|
|
{
|
|
|
ini_set('memory_limit', '2045M');
|
|
|
set_time_limit(0);
|
|
|
@@ -118,7 +129,8 @@ class TestController extends Controller
|
|
|
}
|
|
|
|
|
|
//老油花材单位比修改 ssh 20240411
|
|
|
- public function actionLy()
|
|
|
+ public
|
|
|
+ function actionLy()
|
|
|
{
|
|
|
if (getenv('YII_ENV') == 'production') {
|
|
|
$mainId = 20528;
|
|
|
@@ -168,7 +180,8 @@ class TestController extends Controller
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public function actionItem()
|
|
|
+ public
|
|
|
+ function actionItem()
|
|
|
{
|
|
|
$list = PtItemCatRelateClass::getAllByCondition(['id>' => 0], 'id asc', '*', null, true);
|
|
|
if (!empty($list)) {
|
|
|
@@ -180,7 +193,8 @@ class TestController extends Controller
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public function actionCp()
|
|
|
+ public
|
|
|
+ function actionCp()
|
|
|
{
|
|
|
$list = PtCpItemClass::getAllByCondition(['id>' => 0], 'id asc', '*', null, true);
|
|
|
foreach ($list as $cp) {
|