StoreProductReply.php 786 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace app\controller\merchant\store;
  3. use app\common\repositories\store\product\ProductReplyRepository;
  4. use ln\basic\BaseController;
  5. use think\App;
  6. class StoreProductReply extends BaseController
  7. {
  8. protected $repository;
  9. public function __construct(App $app, ProductReplyRepository $replyRepository)
  10. {
  11. parent::__construct($app);
  12. $this->repository = $replyRepository;
  13. }
  14. public function changeSort($id)
  15. {
  16. $merId = $this->request->merId();
  17. if (!$this->repository->merExists($merId, $id))
  18. return app('json')->fail('数据不存在');
  19. $sort = (int)$this->request->param('sort');
  20. $this->repository->update($id, compact('sort'));
  21. return app('json')->success('修改成功');
  22. }
  23. }