|
|
@@ -4,6 +4,7 @@ namespace console\controllers;
|
|
|
|
|
|
use biz\merchant\services\MerchantService;
|
|
|
use biz\user\services\UserService;
|
|
|
+use biz\wx\services\WxOpenService;
|
|
|
use common\services\xhAdminService;
|
|
|
use common\services\xhMerchantAssetService;
|
|
|
use common\services\xhMerchantExtendService;
|
|
|
@@ -21,7 +22,7 @@ use common\services\xhInitService;
|
|
|
*/
|
|
|
class InitController extends Controller
|
|
|
{
|
|
|
-
|
|
|
+
|
|
|
//开店初始化 shish 2020.2.8
|
|
|
public function actionRabbit()
|
|
|
{
|
|
|
@@ -30,7 +31,7 @@ class InitController extends Controller
|
|
|
$msg = serialize($data);
|
|
|
$producer->publish($msg, 'openShopInitExchange', 'openShopInitRoute');
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
//哪些东西开店时需要初始化!!!!!
|
|
|
public function actionFirstInit()
|
|
|
{
|
|
|
@@ -54,18 +55,26 @@ class InitController extends Controller
|
|
|
{
|
|
|
echo 'ok';
|
|
|
}
|
|
|
-
|
|
|
- //接入一个商家需要的操作 shish 2019.9.7 yii init/join-one 12358
|
|
|
- public function actionJoinOne($id)
|
|
|
+
|
|
|
+ //接入一个商家需要的操作 shish 2019.9.7
|
|
|
+ // yii init/join-one 12358 更新某个商家公众号
|
|
|
+ // yii init/join-one 更新平台公众号
|
|
|
+ public function actionJoinOne($id = 0)
|
|
|
{
|
|
|
//初始化微信菜单
|
|
|
- $merchant = xhMerchantService::getById($id);
|
|
|
+ if ($id == 0) {
|
|
|
+ $isOpen = 1;
|
|
|
+ $merchant = WxOpenService::getWxInfo();
|
|
|
+ } else {
|
|
|
+ $isOpen = 0;
|
|
|
+ $merchant = xhMerchantService::getById($id);
|
|
|
+ }
|
|
|
//xhWxMenuService::applyInit($merchant);
|
|
|
//模板消息
|
|
|
- $r = xhTMessageService::supplement($merchant);
|
|
|
+ $r = xhTMessageService::supplement($merchant, $isOpen);
|
|
|
print_r($r);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
//yii init/sub
|
|
|
public function actionSub()
|
|
|
{
|
|
|
@@ -253,23 +262,4 @@ TRUNCATE xhUserByDay;";
|
|
|
echo "初始化完成!\n";
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 模板消息补充增加
|
|
|
- * ./yii init/t-m-supplement
|
|
|
- */
|
|
|
- public function actionTMSupplement()
|
|
|
- {
|
|
|
- //服务号
|
|
|
- $allMerchant = xhMerchant::getAllByCondition(['status' => 1]);
|
|
|
- if (empty($allMerchant)) {
|
|
|
- echo "没有商家需要初始化模板消息";
|
|
|
- Yii::$app->end();
|
|
|
- }
|
|
|
- foreach ($allMerchant as $val) {
|
|
|
- $merchantId = $val['id'];
|
|
|
- $merchant = xhMerchantService::getById($merchantId);
|
|
|
- xhTMessageService::supplement($merchant);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
}
|