Пример #1
0
 public function encodeJsonItems()
 {
     $items = \App\Model\ItemTemplate::select('id', 'name', 'appearance', 'type', 'level')->where('appearance', '!=', 0)->whereIn('type', [16, 17, 18, 82])->get();
     $json = '{<br/>';
     foreach ($items as $item) {
         $json .= '"' . $item->id . '" : {"name" : "' . e($item->name) . '", "level" : "' . $item->level . '", "type" : "' . $item->type . '", "appearance" : "' . $item->appearance . '"},<br/>';
     }
     $json .= '}';
     return $json;
 }
Пример #2
0
 /**
  * Return itemset's max level
  *
  * @param int $itemsetId
  */
 public function level($itemsetId)
 {
     $item = ItemTemplateManager::select('level')->where('panoplie', $itemsetId)->orderBy('level', 'desc')->first();
     return $item->level;
 }