' => 0], null, '*', null, true); if (!empty($shopList)) { foreach ($shopList as $shop) { $sjId = $shop->sjId ?? 0; $sj = SjClass::getById($sjId, true); if (!empty($sj)) { $beforeDeadline = $sj->beforeDeadline ?? ''; $deadline = $sj->deadline ?? ''; $shop->beforeDeadline = $beforeDeadline; $shop->deadline = $deadline; $shop->save(); echo "shopId:" . $shop->id . " " . $deadline . ' ' . $beforeDeadline . "\n"; } } } } public function actionHdCustom() { ini_set('memory_limit', '2045M'); set_time_limit(0); $customList = CustomClass::getAllByCondition(['id>' => 0], null, '*', null, true); if (!empty($customList)) { foreach ($customList as $custom) { $mobile = $custom->mobile; $custom->originName = $mobile; $custom->name = $mobile; $custom->py = $mobile; $custom->save(); OrderClass::updateByCondition(['customId' => $custom->id], ['customName' => $mobile, 'customNamePy' => $mobile]); } } } //老油花材单位比修改 ssh 20240411 public function actionLy() { if (getenv('YII_ENV') == 'production') { $mainId = 20528; } else { $mainId = 644; } $list = ItemClass::getAllByCondition(['mainId' => $mainId, 'delStatus' => 0], null, '*', null, true); if (!empty($list)) { foreach ($list as $item) { $name = $item->name ?? ''; $has = false; if (strstr($name, '100支') != false) { $ptItemId = $item->itemId ?? 0; $ptItem = PtItemClass::getById($ptItemId, true); if (!empty($ptItem)) { $item->ratio = 100; $item->smallUnit = '支'; $item->smallUnitId = 2; $item->save(); $ptItem->ratio = 100; $ptItem->smallUnit = '支'; $ptItem->smallUnitId = 2; $ptItem->save(); $has = true; } } if (strstr($name, '200支') != false) { $ptItemId = $item->itemId ?? 0; $ptItem = PtItemClass::getById($ptItemId, true); if (!empty($ptItem)) { $item->ratio = 200; $item->smallUnit = '支'; $item->smallUnitId = 2; $item->save(); $ptItem->ratio = 200; $ptItem->smallUnit = '支'; $ptItem->smallUnitId = 2; $ptItem->save(); $has = true; } } if ($has) { echo $name . "\n"; } } } } public function actionItem() { $list = PtItemCatRelateClass::getAllByCondition(['id>' => 0], 'id asc', '*', null, true); if (!empty($list)) { foreach ($list as $item) { $ptItemId = $item->itemId ?? 0; $ptItem = PtItemClass::getById($ptItemId, true); echo $ptItem->name . "\n"; } } } public function actionCp() { $list = PtCpItemClass::getAllByCondition(['id>' => 0], 'id asc', '*', null, true); foreach ($list as $cp) { $ptItemId = $cp->itemId ?? 0; $ptItem = PtItemClass::getById($ptItemId, true); $ptItem->hasCpId = 1; $ptItem->save(); } } }