作者 sgj
1 个管道 的构建 通过 耗费 2 秒

评论显示问题

@@ -20,14 +20,11 @@ class IndexController extends PluginBaseController @@ -20,14 +20,11 @@ class IndexController extends PluginBaseController
20 $post = $data['post']; 20 $post = $data['post'];
21 if(empty($post['content'])) $this->error('评论不能为空!'); 21 if(empty($post['content'])) $this->error('评论不能为空!');
22 $user_id = cmf_get_current_user_id(); 22 $user_id = cmf_get_current_user_id();
23 - dump($user_id);  
24 $User=new UserModel(); 23 $User=new UserModel();
25 $user=$User->getUserInfo(); 24 $user=$User->getUserInfo();
26 if(empty($user)) $this->error('未登录!'); 25 if(empty($user)) $this->error('未登录!');
27 $admin = Db::name("comment")->where('user_id', $user['id'])->field("create_time")->order(["create_time" => "DESC"])->find(); 26 $admin = Db::name("comment")->where('user_id', $user['id'])->field("create_time")->order(["create_time" => "DESC"])->find();
28 if(time()-$admin['create_time']<60) $this->error('1分钟内只能留言一次!'); 27 if(time()-$admin['create_time']<60) $this->error('1分钟内只能留言一次!');
29 - dump($user);  
30 - exit();  
31 $post ['user_id']=$user['id']; 28 $post ['user_id']=$user['id'];
32 $post ['full_name']= $user['user_nickname']?$user['user_nickname']:($user['user_login']?$user['user_login']:$user['mobile']); 29 $post ['full_name']= $user['user_nickname']?$user['user_nickname']:($user['user_login']?$user['user_login']:$user['mobile']);
33 if($post ['full_name'] == $user['mobile']) $post ['full_name']=substr_replace($post ['full_name'], '****', 3, 4); 30 if($post ['full_name'] == $user['mobile']) $post ['full_name']=substr_replace($post ['full_name'], '****', 3, 4);