| 12345678910111213141516171819202122232425262728293031323334 |
- <?php
- namespace console\controllers;
- use biz\sj\services\MerchantService;
- use bizHd\wx\services\WxOpenService;
- use common\components\sms;
- use common\components\util;
- use Yii;
- use yii\console\Controller;
- /**
- * 脚本
- */
- class OpenShopInitController extends Controller
- {
- //开店初始化 ./yii open-shop-init/init ssh 2020.6.10
- public function actionInit($id = 0)
- {
- if (empty($id)) {
- util::stop();
- }
- $return = MerchantService::openShopInit(['sjId' => $id]);
- if ($return == false) {
- //没有初始化成功短信通知管理员
- $merchant = MerchantService::getMerchantById($id);
- $name = $merchant['name'];
- $adminMobile = WxOpenService::getAdminMobile();
- sms::freeSend($adminMobile, "花店:{$name}({$id})初始化没有成功。", $merchant);
- }
- }
- }
|