123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172 |
- <?php
- namespace app\admin\controller\medical;
- use app\admin\controller\BaseController;
- use app\admin\model\MerchantShop;
- use app\admin\server\medical\MedicalCarePostageServer;
- use app\admin\server\medical\MedicalCareProductServer;
- use app\admin\server\medical\ShopServer;
- use app\admin\server\package\PackageGoodsServer;
- class Shop extends BaseController
- {
- /**
- * Notes:店铺列表
- * @return \support\Response
- * User: QJF
- * Date: 2022/9/30
- */
- public function getShopList()
- {
- [$page, $limit] = $this->getPage();
- $keywords = $this->request->get('keywords');
- $result = ShopServer::getShopList($page, $limit,$keywords);
- return json_success($result, '成功');
- }
- /**
- * Notes:根据分类查询店铺列表
- * @return \support\Response
- * User: ZQ
- * Date: 2022/11/8
- */
- public function getCategoryShop()
- {
- $category_id = $this->request->get('shop_category_id');
- $result = ShopServer::getCategoryShop($category_id);
- return json_success($result, '成功');
- }
- /**
- * Notes:根据分类查询店铺列表
- * @return \support\Response
- * User: ZQ
- * Date: 2022/11/8
- */
- public function getCategorysShop()
- {
- $result = ShopServer::getCategorysShop();
- return json_success($result, '成功');
- }
- /**
- * Notes:健康模块店铺列表
- * @return \support\Response
- * User: QJF
- * Date: 2022/11/08
- */
- public function getHealthyShopList()
- {
- $result = ShopServer::getHealthyShopList();
- return json_success($result, '成功');
- }
- /**
- * Notes:添加运费模板
- * @return \support\Response
- * User: QJF
- * Date: 2022/9/28
- *
- */
- public function addShop()
- {
- $param = $this->request->post();
- $this->validateCheck('medical\ShopValidate',
- [
- 'shop_sort' => $param['shop_sort'],
- 'shop_category_id' => $param['shop_category_id'],
- 'shop_name' => $param['shop_name'],
- 'shop_logo' => $param['shop_logo'],
- 'shop_label' => $param['shop_label'],
- 'shop_business_hours' => $param['shop_business_hours'],
- 'shop_type' => $param['shop_type'],
- 'shop_address' => $param['shop_address'],
- 'shop_is_auto' => $param['shop_is_auto'],
- 'shop_lat' => $param['shop_lat'],
- 'shop_lng' => $param['shop_lng'],
- 'shop_phone' => $param['shop_phone'],
- 'shop_real_name' => $param['shop_real_name'],
- ],
- 'add');
- $result = ShopServer::insertShop($param);
- return json_success($result, '添加成功');
- }
- /**
- * Notes:修改店铺
- * @return \support\Response
- * User: QJF
- * Date: 2022/9/30
- */
- public function updateShop()
- {
- $param = $this->request->post();
- $this->validateCheck('medical\ShopValidate',
- [
- 'shop_sort' => $param['shop_sort'],
- 'shop_category_id' => $param['shop_category_id'],
- 'shop_id' => $param['shop_id'],
- 'shop_name' => $param['shop_name'],
- 'shop_logo' => $param['shop_logo'],
- 'shop_label' => $param['shop_label'],
- 'shop_business_hours' => $param['shop_business_hours'],
- 'shop_type' => $param['shop_type'],
- 'shop_address' => $param['shop_address'],
- 'shop_is_auto' => $param['shop_is_auto'],
- 'shop_lat' => $param['shop_lat'],
- 'shop_lng' => $param['shop_lng'],
- 'shop_phone' => $param['shop_phone'],
- 'shop_real_name' => $param['shop_real_name'],
- ], 'update');
- $result = ShopServer::updateShop($param);
- return json_success($result, '修改成功');
- }
- /**
- * Notes:删除权益包
- * @return \support\Response
- * User: QJF
- * Date: 2022/9/23
- */
- public function delShop()
- {
- $shop_id = $this->request->get('shop_id');
- $this->validateCheck('medical\ShopValidate', ['shop_id' => $shop_id], 'del');
- $result = ShopServer::delShop($shop_id);
- if ($result){
- return json_success($result, '删除成功');
- }else{
- throw new \Exception('删除失败!');
- }
- }
- /**
- * Notes:查看模板详情
- * @return \support\Response
- * User: QJF
- * Date: 2022/9/28
- */
- public function infoShop()
- {
- $shop_id = $this->request->get('shop_id');
- $this->validateCheck('medical\ShopValidate', ['shop_id' => $shop_id], 'info');
- $result = ShopServer::infoShop($shop_id);
- if ($result){
- return json_success($result, '获取成功');
- }else{
- throw new \Exception('获取失败!');
- }
- }
- //产品上下架
- public function showShop(){
- $shop_id = $this->request->get('shop_id');
- $shop_status= $this->request->get('shop_status');
- $this->validateCheck('medical\ShopValidate', ['shop_id' => $shop_id], 'del');
- $result = ShopServer::showShop($shop_id,$shop_status);
- if ($result){
- return json_success($result, '成功');
- }else{
- throw new \Exception('失败!');
- }
- }
- }
|