123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?php
- namespace app\admin\controller\goods;
- use app\admin\service\goods\GoodsService;
- use app\admin\service\goods\NewCustomerService;
- use app\admin\validate\goods\GoodsValidate;
- use app\model\Coupon;
- use app\model\Goods;
- use app\model\GoodsDetail;
- use app\model\GoodsLabel;
- use app\model\GoodsRunning;
- use app\model\GoodsSku;
- use app\model\SysCategory;
- use support\Db;
- use support\exception\BusinessException;
- use support\Redis;
- use support\Request;
- use support\Response;
- class NewCustomerController
- {
- /**
- * @Desc 商品详情
- * @Author Gorden
- * @Date 2024/3/28 10:25
- *
- * @param Request $request
- * @return Response
- */
- public function info(Request $request)
- {
- $validate = new GoodsValidate();
- if (!$validate->scene('info')->check($request->get())) {
- return json_fail($validate->getError());
- }
- return NewCustomerService::info($request->get('goods_id'));
- }
- /**
- * @Desc 修改商品
- * @Author Gorden
- * @Date 2024/3/28 13:22
- *
- * @param Request $request
- * @return Response
- */
- public function update(Request $request): Response
- {
- $validate = new GoodsValidate();
- if (!$validate->scene('update')->check($request->post())) {
- return json_fail($validate->getError());
- }
- return NewCustomerService::update($request->post());
- }
- }
|