| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244 |
- <?php
- /**
- * 重庆赤晓店信息科技有限公司
- * https://www.chixiaodian.com
- * Copyright (c) 2023 赤店商城 All rights reserved.
- */
- namespace app\modules\alliance\controllers;
- use app\modules\alliance\controllers\store\SalesmanStoreController;
- use app\modules\alliance\models\salesman\StoreAdminPatternForm;
- use app\modules\alliance\models\ShareQrcodeForm;
- use app\modules\alliance\models\salesman\StoreAdminCommentForm;
- use app\modules\alliance\models\salesman\StoreAdminForm;
- use app\modules\alliance\models\salesman\StoreAdminGoodsForm;
- use app\modules\alliance\models\salesman\StoreAdminUserForm;
- use app\modules\alliance\models\salesman\StoreAdminPrintForm;
- class SalesmanStoreAdminController extends SalesmanStoreController
- {
- //管理中心
- public function actionIndex(){
- $form = new StoreAdminForm();
- $form->store_id = $this->store_id;
- $form->id = $this->s_id;
- $form->is_food = $this->is_food;
- $res = $form->info();
- return $this->asJson($res);
- }
- /**
- * 商品
- **/
- //商品列表
- public function actionGoodsList(){
- $form = new StoreAdminGoodsForm();
- $form->status = get_params('status',-1);
- $form->sort = get_params('sort');
- $form->cat_id = get_params('cat_id');
- $form->min_price = get_params('min_price', 0);
- $form->max_price = get_params('max_price', 0);
- $form->goods_keyword = get_params('goods_keyword');
- $form->store_id = $this->store_id;
- $form->is_food = $this->is_food;
- $res = $form->goodsList();
- return $this->asJson($res);
- }
- //修改标题
- public function actionSetGoodsName(){
- $form = new StoreAdminGoodsForm();
- $form->id = post_params('d');
- $form->goods_name = post_params('name');
- $form->store_id = $this->store_id;
- $res = $form->setGoodsName();
- return $this->asJson($res);
- }
- //删除商品
- public function actionGoodsDel(){
- $form = new StoreAdminGoodsForm();
- $form->id = post_params('id');
- $form->store_id = $this->store_id;
- $res = $form->goodsDel();
- return $this->asJson($res);
- }
- //分享商品
- public function actionShareGoods(){
- $form = new ShareQrcodeForm();
- $form->goods_id = post_params('id');
- $form->type = 0;
- $form->user = get_user();
- $form->user_id = get_user_id();
- $form->store_id = $this->store_id;
- return $this->asJson($form->search());
- }
- //修改上下架状态
- public function actionSetGoodsStatus(){
- $form = new StoreAdminGoodsForm();
- $form->id = post_params('id');
- $form->status = post_params('status');
- $form->store_id = $this->store_id;
- $res = $form->setGoodsStatus();
- return $this->asJson($res);
- }
- //修改价格库存
- public function actionSetGoodsPrice(){
- $form = new StoreAdminGoodsForm();
- $form->id = post_params('id');
- $form->goods_price = post_params('goods_price', 0);
- $form->goods_num = post_params('goods_num', 0);
- $form->attr = post_params('attr', "");
- $form->store_id = $this->store_id;
- $res = $form->setPrice();
- return $this->asJson($res);
- }
- //获取修改商品数据
- public function actionGetGoodsEdit(){
- $form = new StoreAdminGoodsForm();
- $form->id = get_params('id');
- $form->store_id = $this->store_id;
- $form->is_food = $this->is_food;
- $res = $form->getGoodsEdit();
- return $this->asJson($res);
- }
- //获取运费规则
- public function actionGetPostageData(){
- $form = new StoreAdminGoodsForm();
- $form->store_id = $this->store_id;
- $res = $form->getPostageData();
- return $this->asJson($res);
- }
- //保存商品
- public function actionSaveGoods(){
- $form = new StoreAdminGoodsForm();
- $form->goods_info = post_params('goods_info');
- $form->store_id = $this->store_id;
- $res = $form->saveGoods();
- return $this->asJson($res);
- }
- //商品详情
- public function actionGoodsDetail(){
- $form = new StoreAdminGoodsForm();
- $form->id = post_params('id');
- $form->store_id = $this->store_id;
- $res = $form->goodsDetail();
- return $this->asJson($res);
- }
- //获取商品规格信息
- public function actionGetGoodsAttr(){
- $form = new StoreAdminGoodsForm();
- $form->id = post_params('id');
- $form->store_id = $this->store_id;
- $res = $form->getGoodsAttr();
- return $this->asJson($res);
- }
- //分类列表
- public function actionCatList() {
- $form = new StoreAdminGoodsForm();
- $form->store_id = $this->store_id;
- $form->status = get_params('status', 1);
- $form->is_food = $this->is_food;
- $res = $form->catList();
- return $this->asJson($res);
- }
- //分类添加保存
- public function actionCatSave() {
- $form = new StoreAdminGoodsForm();
- $form->cat_name = post_params("name");
- $form->id = post_params("id");
- $form->parent_id = post_params("parent_id", 0);
- $form->pic_url = post_params("pic_url");
- $form->status = post_params("is_show", 1);
- $form->sort = post_params("sort", 1);
- $form->store_id = $this->store_id;
- $res = $form->catAdd();
- return $this->asJson($res);
- }
- //获取分类详情
- public function actionGetCatInfo() {
- $form = new StoreAdminGoodsForm();
- $form->id = post_params("id");
- $form->store_id = $this->store_id;
- $res = $form->catInfo();
- return $this->asJson($res);
- }
- //分类修改状态
- public function actionSetCatStatus() {
- $form = new StoreAdminGoodsForm();
- $form->id = post_params("id");
- $form->status = post_params("status", 0);
- $form->store_id = $this->store_id;
- $res = $form->setCatStatus();
- return $this->asJson($res);
- }
- /**
- * 档口Print
- */
- //获取配置
- public function actionGetPrintConfig() {
- $form = new StoreAdminPrintForm();
- $form->store_id = $this->store_id;
- $res = $form->getPrinteConfig();
- return $this->asJson($res);
- }
- //保存配置
- public function actionSavePrintConfig() {
- $form = new StoreAdminPrintForm();
- $form->id = post_params("id");
- $form->name = post_params("name");
- $form->printer_setting = post_params("printer_setting");
- $form->printer_type = post_params("printer_type");
- $form->store_id = $this->store_id;
- $res = $form->savePrinteConfig();
- return $this->asJson($res);
- }
- /**
- * 物料
- */
- //获取配置
- public function actionPattern() {
- $form = new StoreAdminPatternForm();
- $form->store_id = $this->store_id;
- $form->mini_id = $this->mini_id;
- $form->ali_mini_id = $this->ali_mini_id;
- $form->s_id = $this->s_id;
- $res = $form->getConfig();
- return $this->asJson($res);
- }
- //修改配置
- public function actionSavePattern() {
- $form = new StoreAdminPatternForm();
- $form->store_id = $this->store_id;
- $form->business_model = post_params('business_model', 1);
- $res = $form->saveConfig();
- return $this->asJson($res);
- }
- public function actionSetFoodsQrcode() {
- $form = new StoreAdminPatternForm();
- $form->store_id = $this->store_id;
- $form->mini_id = $this->mini_id;
- $form->ali_mini_id = $this->ali_mini_id;
- $form->s_id = $this->s_id;
- $form->qrcode_id = post_params('qrcode_id', 0);
- $res = $form->setFoodsQrcode();
- return $this->asJson($res);
- }
- }
|