作者 刘锟

Merge remote-tracking branch 'origin/master' into akun

@@ -41,7 +41,7 @@ class DownloadProject extends Command @@ -41,7 +41,7 @@ class DownloadProject extends Command
41 41
42 public function handle(){ 42 public function handle(){
43 $v6WeekModel = new V6WeeklyReport(); 43 $v6WeekModel = new V6WeeklyReport();
44 - $lists = $v6WeekModel->list([],'id',['*'],'desc',2); 44 + $lists = $v6WeekModel->list([],'id',['*'],'desc',100);
45 echo date('Y-m-d H:i:s') . 'start' . PHP_EOL; 45 echo date('Y-m-d H:i:s') . 'start' . PHP_EOL;
46 foreach ($lists as $data){ 46 foreach ($lists as $data){
47 $this->workChatMessage($data,$data['project_id']); 47 $this->workChatMessage($data,$data['project_id']);
@@ -206,7 +206,6 @@ class CopyProject extends Command @@ -206,7 +206,6 @@ class CopyProject extends Command
206 } 206 }
207 return true; 207 return true;
208 } 208 }
209 -  
210 //复制数据库 209 //复制数据库
211 public function copyMysql($project_id,$new_project_id){ 210 public function copyMysql($project_id,$new_project_id){
212 //切换数据库配置 211 //切换数据库配置
@@ -267,7 +266,6 @@ class CopyProject extends Command @@ -267,7 +266,6 @@ class CopyProject extends Command
267 } 266 }
268 return true; 267 return true;
269 } 268 }
270 -  
271 /** 269 /**
272 * @param $message 270 * @param $message
273 * @return bool 271 * @return bool
@@ -136,7 +136,7 @@ class WeekProject extends Command @@ -136,7 +136,7 @@ class WeekProject extends Command
136 $data['daily_average_num'] = round($pv_num_count / 7,2); 136 $data['daily_average_num'] = round($pv_num_count / 7,2);
137 } 137 }
138 138
139 - if($value['is_weekly_report'] != 0){ 139 + if(isset($value['is_weekly_report']) && $value['is_weekly_report'] != 0){
140 $this->workChatMessage($data,$value['id']); 140 $this->workChatMessage($data,$value['id']);
141 } 141 }
142 $v6WeeklyReportModel = new V6WeeklyReport(); 142 $v6WeeklyReportModel = new V6WeeklyReport();
@@ -179,7 +179,7 @@ class WeekProject extends Command @@ -179,7 +179,7 @@ class WeekProject extends Command
179 }; 179 };
180 $country = trim($country,','); 180 $country = trim($country,',');
181 if(!empty($country)){ 181 if(!empty($country)){
182 - $content1 .= '询盘主要来源于'.$country.'等国家地区'; 182 + $content1 .= '询盘主要来源于'.$country.'等国家地区';
183 } 183 }
184 } 184 }
185 $content1 .= '如有高质量客户,请您密切关注与跟进;'; 185 $content1 .= '如有高质量客户,请您密切关注与跟进;';
@@ -46,12 +46,18 @@ class UserLoginLogic @@ -46,12 +46,18 @@ class UserLoginLogic
46 $list = $this->model->list(['mobile'=>$this->param['mobile'], 46 $list = $this->model->list(['mobile'=>$this->param['mobile'],
47 'status'=>$this->model::STATUS_ZERO],'id',['id','project_id']); 47 'status'=>$this->model::STATUS_ZERO],'id',['id','project_id']);
48 }else{ 48 }else{
49 - $password = base64_encode(md5($this->param['password']));  
50 - $list = $this->model->list(['mobile'=>$this->param['mobile'],  
51 - 'password'=>$password,'status'=>$this->model::STATUS_ZERO],'id',['id','project_id']);  
52 - if(empty($list)){ 49 + if($info['is_password'] == $this->model::STATUS_ZERO){//查看是否开启了密码登录:默认未开启
53 //验证code 50 //验证code
54 $list = $this->verifyCode($this->param['mobile'],$this->param['password']); 51 $list = $this->verifyCode($this->param['mobile'],$this->param['password']);
  52 + }else{
  53 + //先验证密码是否正确,在验证验证码
  54 + $password = base64_encode(md5($this->param['password']));
  55 + $list = $this->model->list(['mobile'=>$this->param['mobile'],
  56 + 'password'=>$password,'status'=>$this->model::STATUS_ZERO],'id',['id','project_id']);
  57 + if(empty($list)){
  58 + //默认只能使用验证码登录
  59 + $list = $this->verifyCode($this->param['mobile'],$this->param['password']);
  60 + }
55 } 61 }
56 } 62 }
57 //获取所有项目的项目id 63 //获取所有项目的项目id
@@ -143,10 +149,10 @@ class UserLoginLogic @@ -143,10 +149,10 @@ class UserLoginLogic
143 $smsInfo = $smsModel->formatQuery(['mobile'=>$mobile,'type'=>$smsModel::TYPE_LOGIN])->orderBy('id','desc')->first(); 149 $smsInfo = $smsModel->formatQuery(['mobile'=>$mobile,'type'=>$smsModel::TYPE_LOGIN])->orderBy('id','desc')->first();
144 if(!empty($smsInfo)){ 150 if(!empty($smsInfo)){
145 if(($password != $smsInfo['code']) || ($smsInfo['created_at'] < date('Y-m-d H:i:s',time() - 300))){ 151 if(($password != $smsInfo['code']) || ($smsInfo['created_at'] < date('Y-m-d H:i:s',time() - 300))){
146 - $this->fail('账号密码错误/验证码错误'); 152 + $this->fail('验证码错误,如需账号密码登录,请联系管理员开启');
147 } 153 }
148 }else{ 154 }else{
149 - $this->fail('账号密码错误/验证码错误'); 155 + $this->fail('验证码错误,如需账号密码登录,请联系管理员开启');
150 } 156 }
151 $list = $this->model->list(['mobile'=>$this->param['mobile'],'status'=>$this->model::STATUS_ZERO],['id','project_id']); 157 $list = $this->model->list(['mobile'=>$this->param['mobile'],'status'=>$this->model::STATUS_ZERO],['id','project_id']);
152 return $this->success($list); 158 return $this->success($list);