|
|
@@ -2,6 +2,7 @@
|
|
|
|
|
|
namespace saas\controllers;
|
|
|
|
|
|
+use biz\merchant\services\MerchantExtendService;
|
|
|
use Yii;
|
|
|
use biz\admin\services\AdminService;
|
|
|
use biz\merchant\services\MerchantService;
|
|
|
@@ -197,7 +198,22 @@ class MerchantController extends BaseController
|
|
|
//注释商家 shish 2020.3.4
|
|
|
public function actionCancel()
|
|
|
{
|
|
|
+ if (getenv('YII_ENV') != 'test') {
|
|
|
+ util::fail('只有测试环境才能操作');
|
|
|
+ }
|
|
|
+ $id = Yii::$app->request->get('id', 0);
|
|
|
+ $merchant = MerchantService::getById($id, true);
|
|
|
+ if (isset($merchant->wxAppId) && empty($merchant->wxAppId)) {
|
|
|
+ util::fail('已注销/未授权');
|
|
|
+ }
|
|
|
+ $merchant->wxAppId = '';
|
|
|
+ $merchant->miniAppId = '';
|
|
|
+ $merchant->save();
|
|
|
+ $extend = MerchantExtendService::getByMerchantId($id, true);
|
|
|
+ $extend->miniAppId = '';
|
|
|
+ $extend->wxAppId = '';
|
|
|
+ $extend->save();
|
|
|
util::ok();
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|