| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <?php
- /**
- * User: admin
- * Date Time: 2021/4/7 21:29
- */
- namespace console\controllers;
- use biz\item\classes\PtItemClass;
- use bizGhs\item\classes\ItemClass;
- use bizGhs\item\classes\ItemClassClass;
- use bizGhs\product\classes\ProductClass;
- use common\services\xhItemService;
- use yii\console\Controller;
- class GhsInitController extends Controller
- {
- public function actionInit()
- {
- }
- //清空某个商户的product
- public function actionClearItem($sjId)
- {
- }
- public function actionPtUnit()
- {
- $res = ProductClass::getAllList("*","");
- foreach ($res as $v){
- $id = $v['id'];
- $obigU = $v['bigUnit'];
- $oSmallU = $v['smallUnit'];
- $bigUname = xhItemService::getUnitName($obigU);
- $smallUName = xhItemService::getUnitName($oSmallU);
- $data = [
- 'bigUnitId'=>$obigU,
- 'smallUnitId'=>$oSmallU,
- 'bigUnit'=>$bigUname,
- 'smallUnit'=>$smallUName,
- ];
- ProductClass::updateById($id,$data);
- }
- echo "done";
- }
- }
|