Пример #1
0
 public function combobox_pc()
 {
     $q = Input::get("q");
     $p = DBWOGPlayer::where('p_name', 'like', "%{$q}%")->where('p_npc', '=', '0')->get();
     foreach ($p as $k => $d) {
         $p[$k] = ['value' => $d['p_id'], 'text' => '(' . $d['p_id'] . ') ' . $d['p_name']];
     }
     return Response::json($p);
 }
Пример #2
0
 public function afterValidation(&$data)
 {
     $ex = DBWOGPlayerTeam::find($data['t_id']);
     if ($data['pkval'] && $ex && $data['pkval'] != $data['t_id']) {
         Response::alert("ID重複");
     }
     $ex = DBWOGPlayer::find($data['p_id']);
     if (!$ex) {
         Response::alert("玩家(p_id={$data['p_id']})不存在");
     }
 }
Пример #3
0
 public function afterValidation(&$data)
 {
     $player = DBWOGPlayer::find($data['p_id']);
     if (!$player) {
         Response::alert("拍賣玩家(p_id={$data['p_id']})不存在");
     }
     if ($data['e_p_id'] > 0) {
         $eplayer = DBWOGPlayer::find($data['e_p_id']);
         if (!$eplayer) {
             Response::alert("競標玩家(p_id={$data['e_p_id']})不存在");
         }
     }
     $item = DBWOGItem::find($data['d_id']);
     if (!$item) {
         Response::alert("拍賣物品(d_id={$data['d_id']})不存在");
     }
     $sale = DBWOGItemSale::find($data['s_id']);
     if ($data['pkval'] && $sale && $data['pkval'] != $data['s_id']) {
         Response::alert("ID重複");
     }
 }