Kaynağa Gözat

初始化脚本

shish 6 yıl önce
ebeveyn
işleme
5b0d19024a
1 değiştirilmiş dosya ile 34 ekleme ve 0 silme
  1. 34 0
      console/controllers/OpenShopInitController.php

+ 34 - 0
console/controllers/OpenShopInitController.php

@@ -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);
+        }
+    }
+
+}