uid(); $list = UserEnter::list($where); return app('json')->success($list); } public function apply(Request $request) { if ($request->user()['is_merchant'] == 1) return app('json')->fail('已是商户'); $data = UtilService::postMore([ ['province', ''], ['city', ''], ['district', ''], ['address', ''], ['merchant_name', ''], ['link_user', ''], ['link_tel', ''], ['charter', ''], ]); $validate = Validate::rule(['province' => 'require', 'city' => 'require', 'district' => 'require', 'address' => 'require', 'merchant_name' => 'require', 'link_user' => 'require', 'link_tel' => 'require', 'charter' => 'require',]); $validate->message([ 'province.require' => '请填写所在省', 'city.require' => '请填写所在市', 'district.require' => '请填写所在区', 'address.require' => '请填写详细地址', 'merchant_name.require' => '请填写商户名称', 'link_user.require' => '请填写商户姓名', 'link_tel.require' => '请填写商户电话', 'charter.require' => '请填写商户证书', ]); $data['uid'] = $request->uid(); if (!$validate->check($data)) return app('json')->fail($validate->getError()); $res = UserEnter::create($data); if ($res) return app('json')->success('提交成功'); return app('json')->fail('提交失败'); } }