From b6e386ad1b3c0f58cd026f112c65e3ec11eed0b6 Mon Sep 17 00:00:00 2001 From: lwh <2679599887@qq.com> Date: Sun, 30 Apr 2023 19:31:19 +0800 Subject: [PATCH] =?UTF-8?q?fix=20:=20=20=E4=BF=AE=E6=94=B9=E8=81=94?= =?UTF-8?q?=E7=B3=BB=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ContactUs/ContactInfo.php | 38 +++++++++++-------- .../ContactInfo.php | 17 +++++---- .../{JoinApply => ContactUs}/JoinApply.php | 17 ++++++++- app/common/model/ContactUs/ContactInfo.php | 16 +++++--- 4 files changed, 59 insertions(+), 29 deletions(-) rename app/api/controller/{ContactInfo => ContactUs}/ContactInfo.php (78%) rename app/api/controller/{JoinApply => ContactUs}/JoinApply.php (77%) diff --git a/app/admin/controller/ContactUs/ContactInfo.php b/app/admin/controller/ContactUs/ContactInfo.php index d015c58..5edffc1 100644 --- a/app/admin/controller/ContactUs/ContactInfo.php +++ b/app/admin/controller/ContactUs/ContactInfo.php @@ -23,12 +23,15 @@ class ContactInfo extends BaseController $query = ModelContactInfo::field([ 'contact_info_id', 'contact_info_guid', - 'contact_info_location', - 'latitude', - 'longitude', - 'customer_service_wx', 'contact_info_phone', - 'join_apply_content' + 'contact_info_location', + 'longitude', + 'latitude', + 'contact_info_content', + 'customer_service_wx_img', + 'wx_office_accounts_img', + 'weibo_img', + 'qq_img' ])->where(1)->find(); return [ @@ -45,20 +48,25 @@ class ContactInfo extends BaseController { $params = $request->param(); $this->validate($params, [ - 'contact_info_location|定位' => 'require', - 'customer_service_wx|客户微信' => 'require', - 'contact_info_phone|联系电话' => 'require', - 'join_apply_content|加盟简介' => 'require' + 'contact_info_phone|咨询热线' => 'require', + 'contact_info_content|联系我们简介' => 'require', + 'customer_service_wx_img|客服微信图片' => 'require', + 'wx_office_accounts_img|微信公众号图片' => 'require', + 'weibo_img|官方微博图片' => 'require', + 'qq_img|官方qq图片' => 'require' ]); - $model = ModelContactInfo::where('contact_info_id',1)->find(); + $model = ModelContactInfo::where(1)->find(); $model->allowField([ 'contact_info_update_user_guid', - 'contact_info_location', - 'latitude', - 'longitude', - 'customer_service_wx', 'contact_info_phone', - 'join_apply_content' + 'contact_info_location', + 'longitude', + 'latitude', + 'contact_info_content', + 'customer_service_wx_img', + 'wx_office_accounts_img', + 'weibo_img', + 'qq_img' ])->save($params); return msg('编辑成功!'); } diff --git a/app/api/controller/ContactInfo/ContactInfo.php b/app/api/controller/ContactUs/ContactInfo.php similarity index 78% rename from app/api/controller/ContactInfo/ContactInfo.php rename to app/api/controller/ContactUs/ContactInfo.php index 639efd1..09f6ec0 100644 --- a/app/api/controller/ContactInfo/ContactInfo.php +++ b/app/api/controller/ContactUs/ContactInfo.php @@ -1,6 +1,6 @@ param(); $query = ModelContactInfo::field([ - 'contact_info_id', - 'contact_info_guid', - 'contact_info_location', - 'latitude', - 'longitude', - 'customer_service_wx', 'contact_info_phone', - 'join_apply_content' + 'contact_info_location', + 'longitude', + 'latitude', + 'contact_info_content', + 'customer_service_wx_img', + 'wx_office_accounts_img', + 'weibo_img', + 'qq_img' ])->where(1)->find(); return [ diff --git a/app/api/controller/JoinApply/JoinApply.php b/app/api/controller/ContactUs/JoinApply.php similarity index 77% rename from app/api/controller/JoinApply/JoinApply.php rename to app/api/controller/ContactUs/JoinApply.php index c95369c..4a349e0 100644 --- a/app/api/controller/JoinApply/JoinApply.php +++ b/app/api/controller/ContactUs/JoinApply.php @@ -1,6 +1,6 @@ middleware[SessionInit::class] = [ + 'only' => ['accountLogin', 'getCaptcha'] + ]; + } /** * 添加加盟申请 @@ -30,6 +44,7 @@ class JoinApply extends BaseController 'join_apply_user_position|职位' => 'require', 'join_apply_user_area|所在地区' => 'require', 'join_apply_user_org|所属机构名称' => 'require', + 'captcha|验证码' => 'require|captcha', ]); $model = ModelJoinApply::create($params, [ 'join_apply_guid', diff --git a/app/common/model/ContactUs/ContactInfo.php b/app/common/model/ContactUs/ContactInfo.php index 9683e70..427aaac 100644 --- a/app/common/model/ContactUs/ContactInfo.php +++ b/app/common/model/ContactUs/ContactInfo.php @@ -26,17 +26,23 @@ class ContactInfo extends BaseModel "contact_info_guid" => "string", - "contact_info_location" => "string", + "contact_info_phone" => "string", - "latitude" => "string", + "contact_info_location" => "string", "longitude" => "string", - "customer_service_wx" => "string", + "latitude" => "string", - "contact_info_phone" => "int", + "contact_info_content" => "string", - "join_apply_content" => "string", + "customer_service_wx_img" => "string", + + "wx_office_accounts_img" => "string", + + "weibo_img" => "string", + + "qq_img" => "string", "contact_info_create_time" => "datetime",