2015-09-10 11:32:47 2266次浏览 0条回答 0 悬赏 50 金钱
    public function actionCreate(){
        $userModel = new User();
        $user =  $userModel->isLogin();
        if(!$user){
            return [
                'statusCode'=>-1,
                'statusInfo'=>'unLogin',
            ];}

        $userInfoStatus = $userModel->getUserInfoById($user['uid']);
        if($userInfoStatus['negative_status'] > 0 ){
            return [
                'statusCode' => -1,
                'statusInfo' => '发布失败',
            ];
        }

        $revealModel = new $this->modelClass();
        $revealModel->load(Yii::$app->getRequest()->getBodyParams(), '');

        $itemModel = new Item();
        $revealModel->remind_status = $itemModel->isSensitiveWord($revealModel->comment)?1:0;

        if (!$revealModel->save()) {
            return array_values($revealModel->getFirstErrors())[0];
        }
        return $revealModel;
    }
    没有找到数据。
您需要登录后才可以回答。登录 | 立即注册
trylife
总监

trylife Beijing

注册时间:2015-03-26
最后登录:2020-12-07
在线时长:51小时55分
  • 粉丝39
  • 金钱1626
  • 威望40
  • 积分2536

热门问题