quanwei
17 hours ago ad8477d3ee82a3fffd5de4cd60a237c9ee6b1fb7
admin/app/common/model/plus/release/Chat.php
@@ -25,12 +25,18 @@
    //添加信息
    public function add($postdata,$user)
    {
        // 验证:不能给自己发消息
        if (!isset($postdata['you_user_id']) || $postdata['you_user_id'] == $user['user_id']) {
            $this->error = '不能给自己发消息';
            return false;
        }
        // 开启事务
        $this->startTrans();
        try {
            $ChatRelation = new ChatRelation();
            $info = $ChatRelation->where('user_id', '=', $user['user_id'])->where('other_user_id', '=', $postdata['you_user_id'])->find();
            if(empty($info)){
                $info = $ChatRelation->where('user_id', '=', $postdata['you_user_id'])->where('other_user_id', '=', $user['user_id'])->find();