| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <?php
- /**
- * 重庆赤晓店信息科技有限公司
- * https://www.chixiaodian.com
- * Copyright (c) 2023 赤店商城 All rights reserved.
- */
- namespace app\modules\admin\controllers;
- use app\models\MerchantInfo;
- use app\models\StoreSchedule;
- use app\modules\admin\models\WechatMiniMerchantForm;
- class WechatMiniMerchantController extends BaseController
- {
- public function actionSetMerchantInfo()
- {
- $form = new WechatMiniMerchantForm();
- $form->id = post_params("id", 0) ?: get_params("id", 0);
- //如果是get就获取数据
- if (\Yii::$app->request->isGet) {
- $res = $form->merchantInfo();
- } else {
- $form->merchant_info = post_params("merchant_info");
- $res = $form->save();
- }
- return $this->asJson($res);
- }
- public function actionList()
- {
- $form = new WechatMiniMerchantForm();
- $form->status = get_params("status",-1);
- $res = $form->list();
- return $this->asJson($res);
- }
- public function actionGetCountry()
- {
- $form = new WechatMiniMerchantForm();
- $res = $form->getCountry();
- return $this->asJson($res);
- }
- // 获取小程序开始使用/暂停使用
- public function actionMiniIsUse(){
- $form = new WechatMiniMerchantForm();
- $form->id = post_params("id")??get_params("id");
- $form->is_use = post_params("is_use");
- $res = $form->unbind();
- return $this->asJson($res);
- }
- //绑定商户号 非进件逻辑需要添加进件数据
- public function actionSetTemporaryInfo() {
- $form = new WechatMiniMerchantForm();
- $form->attributes = post_params();
- $form->store_id = get_store_id();
- $res = $form->setTemporaryInfo();
- return $this->asJson($res);
- }
- public function actionDeleteMerchantInfo() {
- $form = new WechatMiniMerchantForm();
- $form->id = post_params("id")??get_params("id");
- $res = $form->deleteMerchantInfo();
- return $this->asJson($res);
- }
- }
|