/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $last_no = DB::table('transactions')->select(DB::raw('substring(transaction_no FROM 5 FOR 6) as transaction_no'))->where('transaction_desc', 'Registration')->first(); if ($last_no == '') { $transaction_no = 'REG-000001'; } else { $lastno = $last_no->transaction_no + 1; $transaction_no = 'REG-' . str_pad($lastno, '6', '0', STR_PAD_LEFT); } $data = ['transaction_no' => $transaction_no, 'card' => Card::orderBy('id', 'desc')->get(), 'payment' => Payment::orderBy('id', 'desc')->get()]; return view('registration.index', $data); }
/** * 前台卡片首页 * @return mixed */ public function index() { // 检索文字列 $strSearchStr = Input::get('search', NULL); $objQuery = Card::orderBy('card_id', 'asc'); if ($strSearchStr) { if (is_numeric($strSearchStr)) { // 全部数字 $objQuery = $objQuery->where('card_id', $strSearchStr); } else { Log::info($strSearchStr); // 根据系列和名称筛选 $objQuery = $objQuery->where('name_jp', 'like', '%' . $strSearchStr . '%')->orWhere('name_cn', 'like', '%' . $strSearchStr . '%')->orWhere('key', 'like', '%' . $strSearchStr . '%')->orWhere('series', 'like', '%' . $strSearchStr . '%'); } } // TODO 高级搜索 $lstCards = $objQuery->get(); return view('card.index')->withSearch($strSearchStr)->withCards($lstCards)->withAbilities(Ability::all())->withType1s(Type1::all())->withType2s(Type2::all())->withAttrs(Attr::all()); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $cards = Card::orderBy('id', 'desc')->get(); return view('card.index', compact('cards')); }
/** * Display a listing of the resource. * * @return Response */ public function index() { return view('admin.card.index')->withCards(Card::orderBy('card_id', 'desc')->get())->withSkills(Skill::all())->withLskills(Lskill::all())->withAbilities(Ability::all())->withType1s(Type1::all())->withType2s(Type2::all())->withAttrs(Attr::all()); }