| | |
| | | |
| | | namespace app\shop\controller\supplier; |
| | | |
| | | use app\common\enum\supplier\SupplierType; |
| | | use app\shop\controller\Controller; |
| | | use app\shop\model\supplier\Supplier as SupplierModel; |
| | | use app\shop\model\supplier\Apply as ApplyModel; |
| | |
| | | */ |
| | | public function index() |
| | | { |
| | | $typeList = SupplierType::getTypeName(); |
| | | //获取该角色管理的区域 by yj 2023.12.20 |
| | | $shop_supplier_ids = SupplierModel::getSupplierIdsByUser($this->store['user']); |
| | | // 供应商列表 |
| | |
| | | $postData["shop_supplier_ids"] = $shop_supplier_ids; |
| | | } |
| | | $list = $model->getList($postData); |
| | | return $this->renderSuccess('', compact('list')); |
| | | return $this->renderSuccess('', compact('list','typeList')); |
| | | } |
| | | |
| | | /** |
| | |
| | | public function add() |
| | | { |
| | | $model = new SupplierModel; |
| | | $category = CategoryModel::getALL(); |
| | | $typeList = SupplierType::getTypeName(); |
| | | |
| | | // 获取请求的供应商类型参数 |
| | | $supplier_type = $this->request->get('supplier_type', 10); // 默认为10(实物) |
| | | |
| | | // 根据供应商类型获取对应的分类 |
| | | $category = CategoryModel::getALL(['category_type'=>$supplier_type]); |
| | | |
| | | $region = AreaModel::getALL(); |
| | | if($this->request->isGet()){ |
| | | return $this->renderSuccess('', compact('category','region')); |
| | | return $this->renderSuccess('', compact('category','region','typeList')); |
| | | } |
| | | // 新增记录 |
| | | if ($model->add($this->postData())) { |
| | |
| | | public function edit($shop_supplier_id) |
| | | { |
| | | $model = SupplierModel::detail($shop_supplier_id, ['logo', 'business', 'qyQrcode','superUser.user']); |
| | | $category = CategoryModel::getALL(); |
| | | $category = CategoryModel::getALL(['category_type'=>$model['supplier_type']]); |
| | | $region = AreaModel::getALL(); |
| | | //获取站点设置 |
| | | $storeValues=SettingModel::getItem('store'); |
| | |
| | | { |
| | | //获取该角色管理的区域 by yj 2023.12.20 |
| | | $area_ids = SupplierModel::getAreaIdsByUser($this->store['user']); |
| | | $typeList = SupplierType::getTypeName(); |
| | | // 供应商列表 |
| | | $model = new ApplyModel; |
| | | $postData = $this->postData(); |
| | | if(!empty($area_ids)){ |
| | | $postData["area_ids"] = $area_ids; |
| | | } |
| | | |
| | | $list = $model->getList($postData); |
| | | return $this->renderSuccess('', compact('list')); |
| | | return $this->renderSuccess('', compact('list','typeList')); |
| | | } |
| | | /** |
| | | * 供应商待审核详情 |