request->params([ ['username', ''], ['password', ''], ]); //校验登录注册配置 (new ConfigService())->checkLoginConfig(MemberLoginTypeDict::USERNAME); //参数验证 //验证码验证 $result = (new LoginService())->account($data['username'], $data['password']); if (!$result) { //账号密码错误, 重置验证码 return fail('ACCOUNT_OR_PASSWORD_ERROR'); } return success($result); } /** * 登出 * @return Response */ public function logout() { (new LoginService)->logout(); return success('MEMBER_LOGOUT'); } /** * 创建验证码 * @return Response */ public function captcha() { return success((new CaptchaService())->create()); } /** * 发送手机验证码 * @param $type * @return Response * @throws Exception */ public function sendMobileCode($type) { $data = $this->request->params([ ['mobile', ''], ]); return success((new LoginService())->sendMobileCode($data['mobile'], $type)); } /** * 手机号登录 * @return Response */ public function mobile() { $data = $this->request->params([ ['mobile', ''], ['nickname', ''], ['headimg', ''], ['mobile', ''] ]); //校验登录注册配置 (new ConfigService())->checkLoginConfig(MemberLoginTypeDict::MOBILE); return success((new LoginService())->mobile($data)); } /** * 重置密码 * @return Response */ public function resetPassword() { $data = $this->request->params([ ['mobile', ''], ['password', ''] ]); //参数验证 $this->validate($data, 'app\validate\member\Member.reset_password'); (new LoginService())->resetPassword($data['mobile'], $data['password']); return success('PASSWORD_RESET_SUCCESS'); } //销售教师人员登陆 // public function personnelLogin() // { // $data = $this->request->params([ // ['phone', ''], // ['password', ''], // ['login_type', ''],//登陆类型|1=教练,2=销售 // ]); // //验证码验证 // $result = (new LoginService())->loginByPersonnel($data); // return success($result);//code|1正确 // } public function test(){ $order = new OrderTable(); $order_info = $order->where(['id' => 8])->find(); event('Student', ['event_type' => 'add','order_info' => $order_info]); } //上课提醒 public function class_reminder(){ //上课提醒 $template_id = Db::name("template_message")->where(['id' => 3])->value('template_id'); $person_course_schedule = new PersonCourseSchedule(); $list = $person_course_schedule ->alias("a") ->join(['school_customer_resources' => 'b'],'a.resources_id = b.id','left') ->join(['school_member' => 'c'],'b.member_id = c.member_id','left') ->join(['school_course_schedule' => 'd'],'a.schedule_id = d.id','left') ->join(['school_course' => 'e'],'d.course_id = e.id','left') ->field("a.id,c.wx_openid,e.course_name,a.course_date,a.time_slot") ->select(); foreach ($list as $k=>$v){ sendMessage( $v['wx_openid'], $template_id, [ 'thing5' => $v['course_name'].',您有一节课程还有不到24小时就要开始了,如需请假请提前6小时发起请假操作。', 'thing19' => $v['course_date'].' '.$v['time_slot'], 'pagepath' => '' ] ); } } }