zm
2021-03-26 e9972339d009cfda3cee8daa6b8f5077251449ef
提货客服登录时,订单列表只能看到兑换中心的订单
8 files modified
46 ■■■■ changed files
.user.ini 2 ●●● patch | view | raw | blame | history
controllers/api/admin/OrderController.php 1 ●●●● patch | view | raw | blame | history
forms/common/CommonUser.php 12 ●●●●● patch | view | raw | blame | history
forms/mall/order/BaseOrderForm.php 9 ●●●● patch | view | raw | blame | history
plugins/exchange/controllers/api/IndexController.php 1 ●●●● patch | view | raw | blame | history
plugins/exchange/forms/api/RecordForm.php 9 ●●●● patch | view | raw | blame | history
views/components/app-order.php 7 ●●●●● patch | view | raw | blame | history
views/components/order/app-search.php 5 ●●●●● patch | view | raw | blame | history
.user.ini
@@ -1 +1 @@
open_basedir="D:/wwwroot/hj.dev.com/;C:/Windows/Temp/;C:/Temp/;D:/BtSoft/temp/session/"
open_basedir="D:/wwwroot/chandizhida-backend/;C:/Windows/Temp/;C:/Temp/;D:/BtSoft/temp/session/"
controllers/api/admin/OrderController.php
@@ -32,6 +32,7 @@
        $res = $form->search();
        $plugins = (new DataForm())->getPluginSign();
        $res['plugin_list'] = $plugins['list_cn'];
        return $this->asJson($res);
    }
forms/common/CommonUser.php
@@ -120,6 +120,18 @@
    }
    /**
     * 获取员工的角色信息
     */
    public static function getUserRole()
    {
        $user = User::find()->where([
            'id' => \Yii::$app->user->id
        ])->with(['role.permissions'])->asArray()->one();
        return $user['role'];
    }
    /**
     * 多商户权限路由
     * @return array
     */
forms/mall/order/BaseOrderForm.php
@@ -9,6 +9,7 @@
use app\core\response\ApiCode;
use app\events\OrderEvent;
use app\forms\common\CommonUser;
use app\forms\common\CommonDistrict;
use app\forms\common\mch\MchSettingForm;
use app\forms\common\order\CommonOrder;
@@ -108,6 +109,11 @@
        if (!$this->validate()) {
            return $this->getErrorResponse();
        }
        $role = CommonUser::getUserRole();
        if($role[0]['name'] == '提货客服'){
            $this->plugin = 'exchange';
        }
        $query = $this->getAllQuery();
        if ($this->flag == "EXPORT") {
@@ -292,7 +298,8 @@
                'export_list' => $this->getFieldsList(),
                'plugins' => $menuList,
                'hide_function' => \Yii::$app->role->getHideFunction(),
                'send_type_list' => $this->getSendTypeList()
                'send_type_list' => $this->getSendTypeList(),
                'role' => $role
            ],
        ];
    }
plugins/exchange/controllers/api/IndexController.php
@@ -94,6 +94,7 @@
    {
        if (\Yii::$app->request->isAjax) {
            $form = new RecordForm();
            $form->card_no = \Yii::$app->request->get('card_no');
            $form->code = \Yii::$app->request->get('code');
            $this->asJson($form->showInfo());
        }
plugins/exchange/forms/api/RecordForm.php
@@ -15,6 +15,7 @@
class RecordForm extends Model
{
    public $code;
    public $card_no;
    public $user_id;
    public $token;
@@ -23,14 +24,15 @@
        return [
            [['code'], 'required'],
            [['user_id'], 'number'],
            [['code', 'token'], 'string'],
            [['code', 'token','card_no'], 'string'],
        ];
    }
    public function attributeLabels()
    {
        return [
            'code' => '兑换码',
            'code' => '密码',
            'card_no'=>'卡号',
            'user_id' => '小程序用户',
        ];
    }
@@ -43,6 +45,7 @@
        $create = new ExchangeFactory(
            $this->code,
            $this->card_no,
            \Yii::$app->user->id,
            '',
            \Yii::$app->appPlatform
@@ -58,6 +61,7 @@
        try {
            $create = new ExchangeFactory(
                $this->code,
                $this->card_no,
                \Yii::$app->user->id,
                $this->token,
                \Yii::$app->appPlatform
@@ -86,6 +90,7 @@
        try {
            $create = new ExchangeFactory(
                $this->code,
                $this->card_no,
                \Yii::$app->user->id,
                $this->token,
                \Yii::$app->appPlatform
views/components/app-order.php
@@ -1799,6 +1799,13 @@
                        if(e.data.data.hide_function) {
                            this.hide_function = e.data.data.hide_function;
                        }
                        if(e.data.data.role[0].name == '提货客服'){
                            this.search.plugin = 'exchange';
                            this.isdisabled = true;
                        }else{
                            this.isdisabled = false;
                        }
                    }
                }).catch(e => {
                });
views/components/order/app-search.php
@@ -105,7 +105,7 @@
            <div v-if="isShowOrderPlugin" class="item-box" flex="dir:left cross:center">
                <div class="label">订单类型</div>
                <el-select size="small" style="width: 120px" v-model="search.plugin" @change="toSearch"
                <el-select size="small" style="width: 120px" v-model="search.plugin" @change="toSearch" :disabled="true"
                           placeholder="订单类型">
                    <el-option v-for="item in plugins" :key="item.sign" :label="item.name"
                               :value="item.sign">
@@ -301,7 +301,8 @@
            return {
                search: {},
                newActiveName: null,
                isShowClear: false,
                isShowClear: false,
                isdisabled:false,
            }
        },
        methods: {