| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- <?php
- // +----------------------------------------------------------------------
- // | likeshop开源商城系统
- // +----------------------------------------------------------------------
- // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
- // | gitee下载:https://gitee.com/likeshop_gitee
- // | github下载:https://github.com/likeshop-github
- // | 访问官网:https://www.likeshop.cn
- // | 访问社区:https://home.likeshop.cn
- // | 访问手册:http://doc.likeshop.cn
- // | 微信公众号:likeshop技术社区
- // | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
- // | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
- // | 禁止对系统程序代码以任何目的,任何形式的再发布
- // | likeshop团队版权所有并拥有最终解释权
- // +----------------------------------------------------------------------
- // | author: likeshop.cn.team
- // +----------------------------------------------------------------------
- namespace app\adminapi\controller\gift_card;
- use app\adminapi\controller\BaseAdminController;
- use app\adminapi\lists\gift_card\GiftCardLists;
- use app\adminapi\lists\gift_card\GiftCardInfoLists;
- use app\adminapi\validate\gift_card\GiftCardValidate;
- use app\adminapi\logic\gift_card\GiftCardLogic;
- class GiftCardController extends BaseAdminController
- {
- /**
- * @notes 礼品卡批次列表
- * @return \think\response\Json
- * @author ljj
- * @date 2022/3/30 5:40 下午
- */
- public function lists()
- {
- return $this->dataLists(new GiftCardLists());
- }
- /**
- * @notes 新增礼品卡
- * @return \think\response\Json
- * @author ljj
- * @date 2022/3/31 11:23 上午
- */
- public function add()
- {
- if($this->request->isPost()) {
- $params = (new GiftCardValidate())->post()->goCheck('add');
- $result = (new GiftCardLogic())->add($params);
- if($result == 'true'){
- return $this->success('新增礼品卡成功');
- }else{
- return $this->fail(GiftCardLogic::getError());
- }
- }else{
- return $this->fail('请求方式错误');
- }
- }
- /**
- * @notes 礼品卡批次卡号详情
- * @return \think\response\Json
- * @author ljj
- * @date 2022/3/31 11:23 上午
- */
- public function cardDetail()
- {
- $params = (new GiftCardValidate())->goCheck('detail');
- return $this->dataLists(new GiftCardInfoLists());
- }
- /**
- * @notes 删除批次
- * @return \think\response\Json
- * @author ljj
- * @date 2022/3/31 2:29 下午
- */
- public function delGiftCard()
- {
- $params = (new GiftCardValidate())->post()->goCheck('delGiftCard');
- $result = (new GiftCardLogic())->deleteGiftCard($params);
- if (true !== $result) {
- return $this->fail(GiftCardLogic::getError());
- }
- return $this->success('删除成功',[],1,1);
- }
- /**
- * @notes 删除礼品卡
- * @return \think\response\Json
- * @author ljj
- * @date 2022/3/31 2:29 下午
- */
- public function delGiftCardInfo()
- {
- $params = (new GiftCardValidate())->post()->goCheck('delGiftCardInfo');
- $result = (new GiftCardLogic())->deleteGiftCardInfo($params);
- if (true !== $result) {
- return $this->fail(GiftCardLogic::getError());
- }
- return $this->success('删除成功',[],1,1);
- }
- }
|