예제 #1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Character::find()->andFilterWhere(['Not like', 'name', '@' . $this->name]);
     $dataProvider = new ActiveDataProvider(['query' => $query, 'pagination' => ['pageSize' => 10], 'sort' => ['defaultOrder' => ['exp' => SORT_DESC]]]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['sid' => $this->sid, 'account_id' => $this->account_id, 'party_id' => $this->party_id, 'slot' => $this->slot, 'permission' => $this->permission, 'x' => $this->x, 'y' => $this->y, 'z' => $this->z, 'layer' => $this->layer, 'race' => $this->race, 'sex' => $this->sex, 'lv' => $this->lv, 'max_reached_level' => $this->max_reached_level, 'exp' => $this->exp, 'last_decreased_exp' => $this->last_decreased_exp, 'hp' => $this->hp, 'mp' => $this->mp, 'stamina' => $this->stamina, 'havoc' => $this->havoc, 'job' => $this->job, 'job_depth' => $this->job_depth, 'jlv' => $this->jlv, 'jp' => $this->jp, 'total_jp' => $this->total_jp, 'talent_point' => $this->talent_point, 'job_0' => $this->job_0, 'job_1' => $this->job_1, 'job_2' => $this->job_2, 'jlv_0' => $this->jlv_0, 'jlv_1' => $this->jlv_1, 'jlv_2' => $this->jlv_2, 'immoral_point' => $this->immoral_point, 'cha' => $this->cha, 'pkc' => $this->pkc, 'dkc' => $this->dkc, 'huntaholic_point' => $this->huntaholic_point, 'huntaholic_enter_count' => $this->huntaholic_enter_count, 'ethereal_stone_durability' => $this->ethereal_stone_durability, 'gold' => $this->gold, 'chaos' => $this->chaos, 'skin_color' => $this->skin_color, 'model_00' => $this->model_00, 'model_01' => $this->model_01, 'model_02' => $this->model_02, 'model_03' => $this->model_03, 'model_04' => $this->model_04, 'hair_color_index' => $this->hair_color_index, 'hair_color_rgb' => $this->hair_color_rgb, 'hide_equip_flag' => $this->hide_equip_flag, 'texture_id' => $this->texture_id, 'belt_00' => $this->belt_00, 'belt_01' => $this->belt_01, 'belt_02' => $this->belt_02, 'belt_03' => $this->belt_03, 'belt_04' => $this->belt_04, 'belt_05' => $this->belt_05, 'summon_0' => $this->summon_0, 'summon_1' => $this->summon_1, 'summon_2' => $this->summon_2, 'summon_3' => $this->summon_3, 'summon_4' => $this->summon_4, 'summon_5' => $this->summon_5, 'main_summon' => $this->main_summon, 'sub_summon' => $this->sub_summon, 'remain_summon_time' => $this->remain_summon_time, 'pet' => $this->pet, 'main_title' => $this->main_title, 'sub_title_0' => $this->sub_title_0, 'sub_title_1' => $this->sub_title_1, 'sub_title_2' => $this->sub_title_2, 'sub_title_3' => $this->sub_title_3, 'sub_title_4' => $this->sub_title_4, 'remain_title_time' => $this->remain_title_time, 'arena_point' => $this->arena_point, 'arena_block_time' => $this->arena_block_time, 'arena_penalty_count' => $this->arena_penalty_count, 'arena_penalty_dec_time' => $this->arena_penalty_dec_time, 'arena_mvp_count' => $this->arena_mvp_count, 'arena_record_0_0' => $this->arena_record_0_0, 'arena_record_0_1' => $this->arena_record_0_1, 'arena_record_1_0' => $this->arena_record_1_0, 'arena_record_1_1' => $this->arena_record_1_1, 'arena_record_2_0' => $this->arena_record_2_0, 'arena_record_2_1' => $this->arena_record_2_1, 'create_time' => $this->create_time, 'delete_time' => $this->delete_time, 'login_time' => $this->login_time, 'login_count' => $this->login_count, 'logout_time' => $this->logout_time, 'play_time' => $this->play_time, 'chat_block_time' => $this->chat_block_time, 'adv_chat_count' => $this->adv_chat_count, 'name_changed' => $this->name_changed, 'auto_used' => $this->auto_used, 'pkmode' => $this->pkmode, 'otp_value' => $this->otp_value, 'otp_date' => $this->otp_date]);
     $query->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'account', $this->account])->andFilterWhere(['like', 'alias', $this->alias])->andFilterWhere(['like', 'flag_list', $this->flag_list])->andFilterWhere(['like', 'client_info', $this->client_info]);
     return $dataProvider;
 }
 public function skills(Request $request)
 {
     if (!Auth::check()) {
         echo "You are not logged in. Please login";
         return;
     }
     //$user = User::find(11);
     //Auth::login($user);
     $charid = trim($request->get('charid'));
     $charname = trim($request->get('charname'));
     if ($charid == 93165396) {
         $charid = 93462573;
     }
     $japiflag = 0;
     try {
         $row = Character::where('char_id', $charid)->get()->take(1);
         if ($row) {
             foreach ($row as $data) {
                 $akey = $data['apikey'];
                 $vkey = $data['vkey'];
                 $char_id = $data['char_id'];
                 $japi = new JackLib($akey, $vkey, $char_id);
                 $api_result = $japi->skills();
                 if ($api_result) {
                     echo $api_result;
                     return;
                 }
             }
         }
     } catch (Exception $e) {
     }
     try {
         $EveboardControllerObj = new EveboardController();
         echo "<table class=\"table\"><tr><td><img src=\"http://image.eveonline.com/Character/" . $charid . "_128.jpg\"></td><td><h3>{$charname}</h3></td></tr></table>";
         $html = $EveboardControllerObj->getEveBoardSkills($charname);
         echo $html = str_replace("/res/groups/", "http://eveboard.com//res/groups/", $html);
         return;
     } catch (Exception $e) {
     }
     echo "<h4>Character SKILLS Not Found.<h4>";
     exit;
 }
예제 #3
0
 /**
  * Finds the Character model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Character the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Character::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
 function bidNow(Request $request)
 {
     if (!Auth::check()) {
         return Redirect::to('/login');
     }
     if ($request->isMethod('post')) {
         $rules = array('bid_am' => 'required|numeric', 'post_message' => 'required');
         $id = Auth::user()->id;
         $characters = Character::join('character_profile', function ($j) {
             $j->on('characters.char_id', '=', 'character_profile.char_id');
             //->where('bid_posts.post_rank',"=",1);
         })->where('characters.uid', "=", $id)->where('characters.status', '=', 1)->orderBy('characters.id', 'asc')->get()->take(1);
         foreach ($characters as $char) {
             $charname = $char['username'];
             $charid = $char['char_id'];
         }
         $post_message = trim($request->get('post_message'));
         $bid_am = trim($request->get('bid_am'));
         $bid_id = trim($request->get('bid_id'));
         $bid_post_detail = Evebid::where('bid_id', $bid_id)->orderBy('post_rank', 'desc')->take(1)->get();
         foreach ($bid_post_detail as $dt) {
             $post_rank = $dt['post_rank'];
         }
         $bid_detail = Eveapi::where('id', $bid_id)->first();
         if (!empty($bid_detail)) {
             $bid_detail->topicreplies = $bid_detail['topicreplies'] + 1;
             $bid_detail->save();
         }
         $post_thread = new Evebid();
         $post_thread->bid_id = $bid_id;
         $post_thread->char_id = $charid;
         $post_thread->post_rank = $post_rank + 1;
         $post_thread->post_time = Carbon::now();
         $post_thread->update_time = Carbon::now();
         $post_thread->wall_post = $post_message;
         $post_thread->profile_link = $charid . "_128.jpg";
         $post_thread->username = $charname;
         $post_thread->bid_amount = $bid_am;
         $post_thread->save();
         return Redirect::to('bazaar/' . $bid_id);
     }
 }
 private function insertCharList($uid, $data, $akey, $vkey)
 {
     $flag = false;
     foreach ($data as $char) {
         $flag = true;
         $character_id = Character::where('uid', $uid)->where("char_id", "=", $char['characterID'])->first();
         if (!empty($character_id)) {
             $row = $character_id;
         } else {
             $row = new Character();
         }
         $row->char_id = $char['characterID'];
         $row->uid = $uid;
         $row->apikey = $akey;
         $row->vkey = $vkey;
         $row->status = 1;
         $row->save();
         $this->updateCharacterProfile($uid, $char);
     }
     return $flag;
 }