示例#1
0
文件: pets.php 项目: saqar/aowow
 protected function generateContent()
 {
     $conditions = [];
     if (!User::isInGroup(U_GROUP_EMPLOYEE)) {
         $conditions[] = [['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0];
     }
     if ($this->category) {
         $conditions[] = ['type', (int) $this->category[0]];
     }
     $pets = new PetList($conditions);
     if (!$pets->error) {
         $this->extendGlobalData($pets->getJSGlobals(GLOBALINFO_RELATED));
         $params = ['visibleCols' => "\$['abilities']"];
         if (!$pets->hasDiffFields(['type'])) {
             $params['hiddenCols'] = "\$['type']";
         }
         $this->lvTabs[] = array('file' => 'pet', 'data' => $pets->getListviewData(), 'params' => $params);
     }
 }
示例#2
0
文件: search.php 项目: Niknox/aowow
 private function _searchPet($cndBase)
 {
     $result = [];
     $cnd = array_merge($cndBase, [$this->createLookup()]);
     $pets = new PetList($cnd);
     if ($data = $pets->getListviewData()) {
         if ($this->searchMask & SEARCH_TYPE_OPEN) {
             foreach ($pets->iterate() as $__) {
                 $data[$pets->id]['param1'] = $pets->getField('iconString');
             }
         }
         $result = array('type' => TYPE_PET, 'appendix' => ' (Pet)', 'matches' => $pets->getMatches(), 'file' => PetList::$brickFile, 'data' => $data, 'params' => []);
         if ($pets->getMatches() > $this->maxResults) {
             $result['params']['note'] = sprintf(Util::$tryNarrowingString, 'LANG.lvnote_petsfound', $pets->getMatches(), $this->maxResults);
             $result['params']['_truncated'] = 1;
         }
     }
     return $result;
 }
示例#3
0
 private function _searchPet($cndBase)
 {
     $cnd = array_merge($cndBase, [$this->createLookup()]);
     $pets = new PetList($cnd);
     if ($data = $pets->getListviewData()) {
         $osInfo = [TYPE_PET, ' (Pet)', $pets->getMatches(), []];
         $result = array('data' => array_values($data), 'computeDataFunc' => '$_');
         if ($this->searchMask & SEARCH_TYPE_OPEN) {
             foreach ($pets->iterate() as $id => $__) {
                 $osInfo[3][$id] = $pets->getField('iconString');
             }
         }
         if ($pets->getMatches() > $this->maxResults) {
             $result['note'] = sprintf(Util::$tryNarrowingString, 'LANG.lvnote_petsfound', $pets->getMatches(), $this->maxResults);
             $result['_truncated'] = 1;
         }
         return ['pet', $result, 'petFoodCol', $osInfo];
     }
     return false;
 }