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

评论显示问题

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