Example #1
0
 /**
  * 取得全部能力的JSON
  *
  * @return Response JSON
  */
 public function abilities()
 {
     $abilities = Ability::all();
     return Response::json($abilities);
 }
Example #2
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     //
     $card = Card::find($id);
     return view('admin.card.edit')->withCard(Card::find($id))->withSkills(Skill::all())->withLskills(Lskill::all())->withAbilities(Ability::all())->withType1s(Type1::all())->withType2s(Type2::all())->withAttrs(Attr::all());
 }
Example #3
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     // Log::info("AbilityIndex");
     return view('admin.ability.index')->withAbilities(Ability::all());
 }
Example #4
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     //
     $card = Card::find($id);
     if (!$card) {
         // 无对应卡片数据
     }
     $skill = null;
     if ($card->skill_id != 0) {
         $skill = Skill::where("skill_id", $card->skill_id)->first();
     }
     $lskill = null;
     if ($card->lskill_id != 0) {
         $lskill = Lskill::where("lskill_id", $card->lskill_id)->first();
     }
     $objEvoTargetCard = null;
     $objMaterial1Card = null;
     $objMaterial2Card = null;
     $objMaterial3Card = null;
     $objMaterial4Card = null;
     if ($card->evo_id != 0) {
         $objEvoTargetCard = Card::where("card_id", $card->evo_id)->first();
         if ($card->material_id1 > 0) {
             $objMaterial1Card = Card::where("card_id", $card->material_id1)->first();
         }
         if ($card->material_id2 > 0) {
             $objMaterial2Card = Card::where("card_id", $card->material_id2)->first();
         }
         if ($card->material_id3 > 0) {
             $objMaterial3Card = Card::where("card_id", $card->material_id3)->first();
         }
         if ($card->material_id4 > 0) {
             $objMaterial4Card = Card::where("card_id", $card->material_id4)->first();
         }
     }
     return view('card.show')->withCard($card)->withSkill($skill)->withLskill($lskill)->withTitle($card->name_jp)->withAbilities(Ability::all())->withType1s(Type1::all())->withType2s(Type2::all())->withEvoTargetCard($objEvoTargetCard)->withMaterial1Card($objMaterial1Card)->withMaterial2Card($objMaterial2Card)->withMaterial3Card($objMaterial3Card)->withMaterial4Card($objMaterial4Card)->withAttrs(Attr::all());
 }