This commit is contained in:
ll 2023-04-26 08:44:54 +08:00
parent 4e7da537b7
commit bc4e3404fa
7 changed files with 146 additions and 101 deletions

View File

@ -25,7 +25,7 @@ class LeaveMessage extends BaseController
$params = $request->param(); $params = $request->param();
$con = []; $con = [];
$con = Tool::getOptionalQuery(); $con = Tool::getOptionalQuery(['leave_message_name', 'LIKE'], ['leave_message_phone', 'LIKE'], ['leave_message_position', '='], ['leave_message_status', '='],);
$query = ModelLeaveMessage::where($con) $query = ModelLeaveMessage::where($con)
->field([ ->field([

View File

@ -3,7 +3,7 @@
namespace app\api\controller\ContactInfo; namespace app\api\controller\ContactInfo;
use app\BaseController; use app\BaseController;
use app\common\model\ContactInfo\ContactInfo as ModelContactInfo; use app\common\model\ContactUs\ContactInfo as ModelContactInfo;
use app\Request; use app\Request;
use think\Validate; use think\Validate;
use think\exception\ValidateException; use think\exception\ValidateException;
@ -21,15 +21,15 @@ class ContactInfo extends BaseController
$params = $request->param(); $params = $request->param();
$query = ModelContactInfo::field([ $query = ModelContactInfo::field([
'contact_info_id', 'contact_info_id',
'contact_info_guid', 'contact_info_guid',
'contact_info_location', 'contact_info_location',
'latitude', 'latitude',
'longitude', 'longitude',
'customer_service_wx', 'customer_service_wx',
'contact_info_phone', 'contact_info_phone',
'join_apply_content' 'join_apply_content'
])->where(1)->find(); ])->where(1)->find();
return [ return [
'code' => 0, 'code' => 0,
@ -37,5 +37,4 @@ class ContactInfo extends BaseController
'msg' => 'ok' 'msg' => 'ok'
]; ];
} }
} }

View File

@ -3,7 +3,7 @@
namespace app\api\controller\JoinApply; namespace app\api\controller\JoinApply;
use app\BaseController; use app\BaseController;
use app\common\model\JoinApply\JoinApply as ModelJoinApply; use app\common\model\ContactUs\JoinApply as ModelJoinApply;
use app\Request; use app\Request;
use think\Validate; use think\Validate;
use think\exception\ValidateException; use think\exception\ValidateException;
@ -25,24 +25,24 @@ class JoinApply extends BaseController
$params = $request->param(); $params = $request->param();
$con = []; $con = [];
$con = Tool::getOptionalQuery(['join_apply_user_name','LIKE'],['join_apply_user_phone','LIKE'],['join_apply_user_position','='],['join_apply_status','='],); $con = Tool::getOptionalQuery(['join_apply_user_name', 'LIKE'], ['join_apply_user_phone', 'LIKE'], ['join_apply_user_position', '='], ['join_apply_status', '='],);
$query = ModelJoinApply::where($con) $query = ModelJoinApply::where($con)
->field([ ->field([
'join_apply_id', 'join_apply_id',
'join_apply_guid', 'join_apply_guid',
'join_apply_user_name', 'join_apply_user_name',
'join_apply_user_phone', 'join_apply_user_phone',
'join_apply_user_position', 'join_apply_user_position',
'join_apply_user_area', 'join_apply_user_area',
'join_apply_user_org', 'join_apply_user_org',
'join_apply_status' 'join_apply_status'
]) ])
->order('join_apply_update_time', 'desc'); ->order('join_apply_update_time', 'desc');
return msg("获取加盟申请列表成功!",$query);
return msg("获取加盟申请列表成功!", $query);
} }
/** /**
@ -55,19 +55,45 @@ class JoinApply extends BaseController
$this->validate($params, ['join_apply_guid' => 'require']); $this->validate($params, ['join_apply_guid' => 'require']);
$find = ModelJoinApply::field([ $find = ModelJoinApply::field([
'join_apply_id', 'join_apply_id',
'join_apply_guid', 'join_apply_guid',
'join_apply_user_name', 'join_apply_user_name',
'join_apply_user_phone', 'join_apply_user_phone',
'join_apply_user_position', 'join_apply_user_position',
'join_apply_user_area', 'join_apply_user_area',
'join_apply_user_org', 'join_apply_user_org',
'join_apply_status' 'join_apply_status'
]) ])
->where('join_apply_guid',$params['join_apply_guid']) ->where('join_apply_guid', $params['join_apply_guid'])
->find(); ->find();
return msg(0,'获取加盟申请详情成功!',['data' => $find]); return msg(0, '获取加盟申请详情成功!', ['data' => $find]);
}
/**
* 添加加盟申请
*/
public function addJoinApply(Request $request): array
{
$params = $request->param();
$this->validate($params, [
'join_apply_user_name|加盟申请用户名字' => 'require',
'join_apply_user_phone|加盟申请用户电话' => 'require',
'join_apply_user_position|加盟申请用户职位' => 'require',
'join_apply_user_area|加盟申请用户所在地区' => 'require',
'join_apply_user_org|加盟申请用户所属机构名称' => 'require',
]);
$model = ModelJoinApply::create($params, [
'join_apply_guid',
'join_apply_create_user_guid',
'join_apply_update_user_guid',
'join_apply_user_name',
'join_apply_user_phone',
'join_apply_user_position',
'join_apply_user_area',
'join_apply_user_org',
'join_apply_status'
]);
return msg('添加成功!');
} }
} }

View File

@ -3,7 +3,7 @@
namespace app\api\controller\LeaveMessage; namespace app\api\controller\LeaveMessage;
use app\BaseController; use app\BaseController;
use app\common\model\LeaveMessage\LeaveMessage as ModelLeaveMessage; use app\common\model\ContactUs\LeaveMessage as ModelLeaveMessage;
use app\Request; use app\Request;
use think\Validate; use think\Validate;
use think\exception\ValidateException; use think\exception\ValidateException;
@ -29,18 +29,18 @@ class LeaveMessage extends BaseController
$query = ModelLeaveMessage::where($con) $query = ModelLeaveMessage::where($con)
->field([ ->field([
'leave_message_id', 'leave_message_id',
'leave_message_guid', 'leave_message_guid',
'leave_message_content', 'leave_message_content',
'leave_message_status', 'leave_message_status',
'leave_message_user_name', 'leave_message_user_name',
'leave_message_user_phone' 'leave_message_user_phone'
]) ])
->order('leave_message_update_time', 'desc'); ->order('leave_message_update_time', 'desc');
return msg("获取用户留言列表成功!",$query);
return msg("获取用户留言列表成功!", $query);
} }
/** /**
@ -53,17 +53,39 @@ class LeaveMessage extends BaseController
$this->validate($params, ['leave_message_guid' => 'require']); $this->validate($params, ['leave_message_guid' => 'require']);
$find = ModelLeaveMessage::field([ $find = ModelLeaveMessage::field([
'leave_message_id', 'leave_message_id',
'leave_message_guid', 'leave_message_guid',
'leave_message_content', 'leave_message_content',
'leave_message_status', 'leave_message_status',
'leave_message_user_name', 'leave_message_user_name',
'leave_message_user_phone' 'leave_message_user_phone'
]) ])
->where('leave_message_guid',$params['leave_message_guid']) ->where('leave_message_guid', $params['leave_message_guid'])
->find(); ->find();
return msg(0,'获取用户留言详情成功!',['data' => $find]); return msg(0, '获取用户留言详情成功!', ['data' => $find]);
}
/**
* 添加用户留言
*/
public function addLeaveMessage(Request $request): array
{
$params = $request->param();
$this->validate($params, [
'leave_message_content|留言内容' => 'require',
'leave_message_user_name|留言人名称' => 'require',
'leave_message_user_phone|留言人手机号码' => 'require'
]);
$model = ModelLeaveMessage::create($params, [
'leave_message_guid',
'leave_message_create_user_guid',
'leave_message_update_user_guid',
'leave_message_content',
'leave_message_status',
'leave_message_user_name',
'leave_message_user_phone'
]);
return msg('添加成功!');
} }
} }

View File

@ -3,7 +3,7 @@
namespace app\api\controller\Teachers; namespace app\api\controller\Teachers;
use app\BaseController; use app\BaseController;
use app\common\model\Teachers\Teachers as ModelTeachers; use app\common\model\Teachers_strength\Teacher as ModelTeachers;
use app\Request; use app\Request;
use think\Validate; use think\Validate;
use think\exception\ValidateException; use think\exception\ValidateException;
@ -25,24 +25,24 @@ class Teachers extends BaseController
$params = $request->param(); $params = $request->param();
$con = []; $con = [];
$con = Tool::getOptionalQuery(['teacher_name','LIKE'],['teacher_position','='],['subject_guid','='],); $con = Tool::getOptionalQuery(['teacher_name', 'LIKE'], ['teacher_position', '='], ['subject_guid', '='],);
$query = ModelTeachers::where($con) $query = ModelTeachers::where($con)
->field([ ->field([
'teacher_id', 'teacher_id',
'teacher_guid', 'teacher_guid',
'teacher_name', 'teacher_name',
'teacher_position', 'teacher_position',
'teacher_img', 'teacher_img',
'subject_guid', 'subject_guid',
'teacher_intro', 'teacher_intro',
'teacher_order' 'teacher_order'
]) ])
->order('teacher_update_time', 'desc'); ->order('teacher_update_time', 'desc');
return msg("获取教师列表成功!",$query);
return msg("获取教师列表成功!", $query);
} }
/** /**
@ -55,19 +55,18 @@ class Teachers extends BaseController
$this->validate($params, ['teacher_guid' => 'require']); $this->validate($params, ['teacher_guid' => 'require']);
$find = ModelTeachers::field([ $find = ModelTeachers::field([
'teacher_id', 'teacher_id',
'teacher_guid', 'teacher_guid',
'teacher_name', 'teacher_name',
'teacher_position', 'teacher_position',
'teacher_img', 'teacher_img',
'subject_guid', 'subject_guid',
'teacher_intro', 'teacher_intro',
'teacher_order' 'teacher_order'
]) ])
->where('teacher_guid',$params['teacher_guid']) ->where('teacher_guid', $params['teacher_guid'])
->find(); ->find();
return msg(0,'获取教师详情成功!',['data' => $find]); return msg(0, '获取教师详情成功!', ['data' => $find]);
} }
} }

View File

@ -29,16 +29,16 @@ class infoArticleType extends BaseController
$query = ModelinfoArticleType::where($con) $query = ModelinfoArticleType::where($con)
->field([ ->field([
'info_article_type_id', 'info_article_type_id',
'info_article_type_guid', 'info_article_type_guid',
'info_article_type_name', 'info_article_type_name',
'info_article_type_sort' 'info_article_type_sort'
]) ])
->order('info_article_type_sort', 'asc'); ->order('info_article_type_sort', 'asc');
return msg("获取资讯文章类型列表成功!",$query);
return msg("获取资讯文章类型列表成功!", $query);
} }
/** /**
@ -51,15 +51,14 @@ class infoArticleType extends BaseController
$this->validate($params, ['info_article_type_guid' => 'require']); $this->validate($params, ['info_article_type_guid' => 'require']);
$find = ModelinfoArticleType::field([ $find = ModelinfoArticleType::field([
'info_article_type_id', 'info_article_type_id',
'info_article_type_guid', 'info_article_type_guid',
'info_article_type_name', 'info_article_type_name',
'info_article_type_sort' 'info_article_type_sort'
]) ])
->where('info_article_type_guid',$params['info_article_type_guid']) ->where('info_article_type_guid', $params['info_article_type_guid'])
->find(); ->find();
return msg(0,'获取资讯文章类型详情成功!',['data' => $find]); return msg(0, '获取资讯文章类型详情成功!', ['data' => $find]);
} }
} }

View File

@ -3,7 +3,7 @@
namespace app\api\controller\Subject; namespace app\api\controller\Subject;
use app\BaseController; use app\BaseController;
use app\common\model\Subject\Subject as ModelSubject; use app\common\model\Teachers_strength\Subject as ModelSubject;
use app\Request; use app\Request;
use think\Validate; use think\Validate;
use think\exception\ValidateException; use think\exception\ValidateException;