|
|
@@ -328,7 +328,7 @@ class JiamengController extends HomeBaseController
|
|
|
|
|
|
// print_r($param);exit;
|
|
|
//判断是否已超过10次 今天这个ip是否留言过
|
|
|
- $sum = MessageService::getTodyCount(['ip'=> $param['ip'],'type'=> 1]);
|
|
|
+ /* $sum = MessageService::getTodyCount(['ip'=> $param['ip'],'type'=> 1]);
|
|
|
if($sum>0){
|
|
|
$this->error('今日留言已超过1次,明天再来吧!');
|
|
|
}
|
|
|
@@ -336,6 +336,20 @@ class JiamengController extends HomeBaseController
|
|
|
$sum = MessageService::getWeekCount(['mobile'=> $param['mobile'],'type'=> 1]);
|
|
|
if($sum>0){
|
|
|
$this->error('您的手机号在本周内已预留过,下周再来吧!');
|
|
|
+ }*/
|
|
|
+ $week_time=time()-604800;
|
|
|
+
|
|
|
+ $res_mobile=Db::name('message')->where('mobile',$param['mobile'])->where('create_time','>',$week_time)->find();
|
|
|
+ if($res_mobile)
|
|
|
+ {
|
|
|
+ $this->error('手机号码一个周内只能留一次');
|
|
|
+ }
|
|
|
+ $ip=get_client_ip();
|
|
|
+ $start_time=strtotime(date('Y-m-d') );
|
|
|
+ $ip_count=Db::name('message')->where('ip',$ip)->where('create_time','>',$start_time)->count();
|
|
|
+ if($ip_count>1)
|
|
|
+ {
|
|
|
+ $this->error('同一个ip一天只可以留言2次');
|
|
|
}
|
|
|
$res = Db::name('message')->insert($param);
|
|
|
if($res){
|