123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- <?php
- namespace app\admin\controller\medical;
- use app\admin\controller\BaseController;
- use app\admin\server\medical\MedicalCarePostageServer;
- use app\admin\server\medical\MedicalCareProductServer;
- use app\admin\server\medical\NewsCategoryServer;
- use app\admin\server\package\PackageGoodsServer;
- class NewsCategory extends BaseController
- {
- /**
- * Notes:文章分类
- * @return \support\Response
- * User: QJF
- * Date: 2022/9/28
- */
- public function getCategoryList()
- {
- [$page, $limit] = $this->getPage();
- $keywords = $this->request->get('keywords');
- $result = NewsCategoryServer::getCategoryList($page, $limit,$keywords);
- return json_success($result, '成功');
- }
- /**
- * Notes:添加运费模板
- * @return \support\Response
- * User: QJF
- * Date: 2022/9/28
- *
- */
- public function addPostage()
- {
- $param = $this->request->post();
- $this->validateCheck('medical\MedicalCarePostagetValidate',
- [
- 'postage_name' => $param['postage_name'],
- 'postage_type_id' => $param['postage_type_id'],
- 'postage_first_weight' => $param['postage_first_weight'],
- 'postage_first_price' => $param['postage_first_price'],
- 'postage_extend_weight' => $param['postage_extend_weight'],
- 'postage_extend_price' => $param['postage_extend_price'],
- ],
- 'add');
- $result = MedicalCarePostageServer::insertPostage($param);
- return json_success($result, '添加成功');
- }
- /**
- * Notes:修改产品
- * @return \support\Response
- * User: QJF
- * Date: 2022/9/23
- */
- public function updatePostage()
- {
- $param = $this->request->post();
- $this->validateCheck('medical\MedicalCarePostagetValidate',
- [
- 'postage_id' => $param['postage_id'],
- 'postage_name' => $param['postage_name'],
- 'postage_type_id' => $param['postage_type_id'],
- 'postage_first_weight' => $param['postage_first_weight'],
- 'postage_first_price' => $param['postage_first_price'],
- 'postage_extend_weight' => $param['postage_extend_weight'],
- 'postage_extend_price' => $param['postage_extend_price'],
- ], 'update');
- $result = MedicalCarePostageServer::updatePostage($param);
- return json_success($result, '修改成功');
- }
- /**
- * Notes:删除权益包
- * @return \support\Response
- * User: QJF
- * Date: 2022/9/23
- */
- public function delPostage()
- {
- $postage_id = $this->request->get('postage_id');
- $this->validateCheck('medical\MedicalCarePostagetValidate', ['postage_id' => $postage_id], 'del');
- $result = MedicalCarePostageServer::delPostage($postage_id);
- if ($result){
- return json_success($result, '删除成功');
- }else{
- throw new \Exception('删除失败!');
- }
- }
- /**
- * Notes:查看模板详情
- * @return \support\Response
- * User: QJF
- * Date: 2022/9/28
- */
- public function infoPostage()
- {
- $postage_id = $this->request->get('postage_id');
- $this->validateCheck('medical\MedicalCarePostagetValidate', ['postage_id' => $postage_id], 'info');
- $result = MedicalCarePostageServer::infoPostage($postage_id);
- if ($result){
- return json_success($result, '获取成功');
- }else{
- throw new \Exception('获取失败!');
- }
- }
- //产品上下架
- public function showPostage(){
- $postage_id = $this->request->get('postage_id');
- $postage_status= $this->request->get('postage_status');
- $this->validateCheck('medical\MedicalCarePostagetValidate', ['postage_id' => $postage_id], 'del');
- $result = MedicalCarePostageServer::showPostage($postage_id,$postage_status);
- if ($result){
- return json_success($result, '成功');
- }else{
- throw new \Exception('失败!');
- }
- }
- }
|