one(array('uid' => $uid, 'project_id' => $project_id, 'system_source' => $system_source)); } public function update($uid, $openid, $system_source = 5, $project_id = 1) { $info = $this->getInfo($uid, $system_source, $project_id); $data['uid'] = $uid; $data['openid'] = $openid; $data['system_source'] = $system_source; $data['project_id'] = $project_id; if ($info) { $data['where_id'] = $info['id']; return Dever::db('user/wechat')->update($data); } else { return Dever::db('user/wechat')->insert($data); } } }