| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- <?php
- /**
- * 重庆赤晓店信息科技有限公司
- * https://www.chixiaodian.com
- * Copyright (c) 2023 赤店商城 All rights reserved.
- */
- namespace app\modules\alliance\controllers;
- use app\models\Admin;
- use app\models\AgentApply;
- use app\models\Option;
- use app\models\Order;
- use app\models\Salesman;
- use app\models\SharingReceiver;
- use app\models\Store;
- use app\models\StoreReOrder;
- use app\models\StoreShareMoney;
- use app\models\User;
- use app\models\UserShareMoney;
- use app\modules\alliance\controllers\BaseController;
- use app\modules\alliance\models\AgencyForm;
- class AgencyController extends BaseController
- {
- public function actionLowerLevelShop(){
- $form = new AgencyForm();
- $form->attributes = post_params();
- $res = $form->lowerLevelShop();
- return $this->asJson($res);
- }
- //店铺订单
- public function actionShopOrder(){
- $form = new AgencyForm();
- $form->attributes = post_params();
- $res = $form->shopOrder();
- return $this->asJson($res);
- }
- //店铺续费订单
- public function actionStoreReOrder(){
- $form = new AgencyForm();
- $form->attributes = post_params();
- $res = $form->storeReOrder();
- return $this->asJson($res);
- }
- //店铺续费订单
- public function actionGetDataInfo(){
- $form = new AgencyForm();
- $res = $form->getDataInfo();
- return $this->asJson($res);
- }
- //佣金明细
- public function actionCommission(){
- $form = new AgencyForm();
- $form->attributes = post_params();
- $res = $form->commission();
- return $this->asJson($res);
- }
- //代理中心配置
- public function actionAgencyConfig(){
- $data = Option::get('agency_config', 0, 'saas');
- $type = input_params('type', 0);
- if (empty($data['value'])) {
- $data = [
- 'lowerLevelShop' => "",
- 'lowerLevelShopIcon' => "",
- 'renewOrder' => "",
- 'renewOrderIcon' => "",
- 'Withdrawal' => "",
- 'WithdrawalIcon' => "",
- 'commissionDetail' => "",
- 'commissionDetailIcon'=> "",
- 'WithdrawalLog' => "",
- 'WithdrawalLogIcon' => "",
- 'shopOrder' => "",
- 'shopOrderIcon' => ""
- ];
- } else {
- $data = json_decode($data['value'], true);
- }
- if (in_array($type, [0, 1, 2])) {
- $agent_apply = AgentApply::findOne(['saas_user_id' => get_saas_user()->id, 'is_delete' => 0, 'agent_type' => $type]);
- $admin_type = 'admin';
- if ((int)$type === 1) {
- $admin_type = 'bd_agent';
- }
- if ((int)$type === 2) {
- $admin_type = 'goods_agent';
- }
- $admin = Admin::findOne(['saas_user_id' => get_saas_user()->id, 'is_delete' => 0, 'type' => $admin_type]);
- $login_data = [
- 'name' => $agent_apply->username ?: $admin->username,
- 'password' => $agent_apply->password ?: '',
- 'url' => "https://" . \Yii::$app->request->hostName,
- 'type' => $type
- ];
- $data = array_merge($data, $login_data);
- }
- return $this->asJson([
- 'code' => 0,
- 'msg' => 'success',
- 'data' => $data,
- ]);
- }
- }
|