Пример #1
0
 /**
  * 获得物品的卖出价格
  */
 private function getMapItemSellPrice($map_x, $map_y)
 {
     $map = new MapModel();
     $item = $map->getMapItem($this->uid, $map_x, $map_y);
     if (!$item) {
         return 0;
     }
     $store = new StoreModel($this->lang);
     $storeData = $store->getStoreById($item->id);
     if (!$storeData) {
         return 0;
     }
     if (isset($storeData->sell_price)) {
         $price = $storeData->sell_price;
     } else {
         $price = 0;
     }
     if (isset($storeData->need_animals)) {
         $animal = $store->getStoreById($storeData->animal);
         $price = $storeData->sell_price + $animal->sell_price * $item->animals;
     }
     return $price;
 }