| 1234567891011121314151617181920212223 |
- <?php
- namespace addons\WechatVideoShop\console\controllers;
- use addons\WechatVideoShop\common\models\WechatVideoShopExpressTemplate;
- use yii\console\Controller;
- class FixController extends Controller
- {
- public function actionExpressTemplate()
- {
- /**
- * @var $each WechatVideoShopExpressTemplate
- */
- foreach (WechatVideoShopExpressTemplate::find()->where('==', 't_hash', '')->each() as $each) {
- $t_hash = json_encode($each->content);
- $each->t_hash = $t_hash;
- if (!$each->save()) {
- var_dump($each->getErrorMessage());
- }
- }
- }
- }
|