| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 | <?phpnamespace app\api\controller\shop;use app\dict\shop\ShopApplyDict;use app\service\admin\shop\admin\ShopCategoryService;use app\service\api\agreement\AgreementService;use app\service\api\shop\ShopApplyService;use app\service\admin\site\SiteGroupService;use core\base\BaseApiController;use think\Response;class ShopApply extends BaseApiController{    /**     * 店铺申请列表     * @return Response     */    public function lists()    {        $data = $this->request->params([            [ 'status', '' ]        ]);        return success((new ShopApplyService())->getPage($data));    }    /**     * 店铺申请详情     * @return Response     */    public function info($id)    {        return success((new ShopApplyService())->getInfo($id));    }    /**     * 添加店铺申请     * @return Response     */    public function add()    {        $data = $this->request->params([            [ 'site_name', '' ],            [ 'user_name', '' ],            [ 'user_mobile', '' ],            [ 'category_id', '' ],            [ 'group_id', '' ],            [ 'business_license', '' ],            [ 'status', 1 ]        ]);        $this->validate($data, 'app\validate\shop\ShopApply.add');        $id = ( new ShopApplyService() )->add($data);        return success('ADD_SUCCESS', [ 'id' => $id ]);    }    /**     * 编辑店铺申请     * @param $id - 店铺申请id     * @return Response     */    public function edit($id)    {        $data = $this->request->params([            [ 'site_name', '' ],            [ 'user_name', '' ],            [ 'user_mobile', '' ],            [ 'category_id', '' ],            [ 'group_id', '' ],            [ 'business_license', '' ],            [ 'status', 1 ]        ]);        $this->validate($data, 'app\validate\shop\ShopApply.edit');        ( new ShopApplyService() )->edit($id, $data);        return success('EDIT_SUCCESS');    }    /**     * 查询店铺分类列表     * @return Response     */    public function shopCategory()    {        $data = $this->request->params([            [ 'category_name', '' ],        ]);        return success(( new ShopCategoryService() )->getList($data ,'category_id, category_name'));    }    /**     * 查询店铺套餐列表     * @return Response     */    public function siteGroup()    {        $data = $this->request->params([            [ 'group_name', '' ],        ]);        return success(( new SiteGroupService() )->getList($data ,'group_id, group_name'));    }    /**     * 获取店铺申请协议内容     * @return Response     */    public function agreement()    {        return success(( new AgreementService() )->getAgreement('apply'));    }    /**     * 店铺申请状态     * @return Response     */    public function statusList()    {        return success((new ShopApplyService())->getStatusList());    }}
 |