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