tablePrefix ='tab_'; /* 执行构造方法 */ parent::__construct($name, $tablePrefix, $connection); } /** * 发送站内信 * @param array $user_id 用户id * @param string $content 内容 * @param int $type 类型 1:后台 * @param int $status 状态 -1:删除 1:已读 2:未读 * @return bool|string */ public function sendMsg($user_id=array(),$content="",$type=1,$status=2){ foreach($user_id as $value){ $data[] = array( 'user_id' => $value['id'], 'content' => $content, 'type' => $type, 'status' => $status, 'create_time' => time(), ); } return $this->addAll($data); } public function sendMsg2($user_id=array(),$content="",$sdk_version=1,$game_id=0,$type=1,$status=2){ foreach($user_id as $value){ $data[] = array( 'user_id' => $value['id'], 'content' => $content, 'type' => $type, 'status' => $status, 'create_time' => time(), 'sdk_version'=>$sdk_version, 'game_id' =>$game_id, ); } return $this->addAll($data); } }