|
|
@@ -79,12 +79,13 @@ class MessageController extends AdminBaseController{
|
|
|
->alias('p1')
|
|
|
->leftJoin('mobile_log p2','p1.`id`=p2.`msg_id`')
|
|
|
->group('p1.`id`')
|
|
|
+ ->order('p1.id','desc')
|
|
|
->field($field)->where('p1.catid','in',$cates)->where($map2)->limit(0,$from)->select();
|
|
|
|
|
|
}else{
|
|
|
|
|
|
$field=['*'];
|
|
|
- $lists = Db::name('message')->field($field)->where('catid','in',$cates)->where($map)->order('id')->limit(0,$from)->select();
|
|
|
+ $lists = Db::name('message')->field($field)->where('catid','in',$cates)->where($map)->order('id','desc')->limit(0,$from)->select();
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -269,7 +270,20 @@ class MessageController extends AdminBaseController{
|
|
|
$param['jm_title'] = $info['title'];
|
|
|
}
|
|
|
}
|
|
|
- // ppppppppp
|
|
|
+ //mobile
|
|
|
+
|
|
|
+ if(strlen($param['mobile']) == 11)
|
|
|
+ {
|
|
|
+ if(!$this->checkPhoneNumberValidate($param['mobile'])){
|
|
|
+ $this->error('手机号码不正确');
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }else{
|
|
|
+ $this->error('手机号码不正确');
|
|
|
+ }
|
|
|
+
|
|
|
+ // ppppppppp
|
|
|
if($param['catname']){
|
|
|
$cat=Db::name('category')->where('catname',$param['catname'])->find();
|
|
|
if(!empty($cat)){
|
|
|
@@ -293,7 +307,24 @@ class MessageController extends AdminBaseController{
|
|
|
}
|
|
|
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+ private function checkPhoneNumberValidate($phone_number){
|
|
|
+
|
|
|
+ $g = "/^1[34578]\d{9}$/";
|
|
|
+ $g2 = "/^19[89]\d{8}$/";
|
|
|
+ $g3 = "/^166\d{8}$/";
|
|
|
+ if(preg_match($g, $phone_number)){
|
|
|
+ return true;
|
|
|
+ }else if(preg_match($g2, $phone_number)){
|
|
|
+ return true;
|
|
|
+ }else if(preg_match($g3, $phone_number)){
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ return false;
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 信息分配给用户
|