<?php



namespace app\controller\merchant\store;


use app\common\repositories\store\product\ProductReplyRepository;
use ln\basic\BaseController;
use think\App;

class StoreProductReply extends BaseController
{
    protected $repository;

    public function __construct(App $app, ProductReplyRepository $replyRepository)
    {
        parent::__construct($app);
        $this->repository = $replyRepository;
    }

    public function changeSort($id)
    {
        $merId = $this->request->merId();
        if (!$this->repository->merExists($merId, $id))
            return app('json')->fail('数据不存在');

        $sort = (int)$this->request->param('sort');

        $this->repository->update($id, compact('sort'));
        return app('json')->success('修改成功');
    }

}