Files
OMS/app/omeanalysts/lib/shop.php
2025-12-28 23:13:25 +08:00

53 lines
1.2 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
/**
* Copyright © ShopeX http://www.shopex.cn. All rights reserved.
* See LICENSE file for license details.
*/
class omeanalysts_shop{
/**
* 根据平台类型返回对应店铺id
* @return
*/
public function getShopList(){
$shopModel = app::get('ome')->model('shop');
$shopList = $shopModel->getList('shop_id,shop_type');
$shops = array();
foreach($shopList as $shop){
$shops[$shop['shop_type']][] = $shop['shop_id'];
}
return $shops;
}
public function getShopDetail($shop_id){
static $shop;
if ($shop[$shop_id]) return $shop[$shop_id];
$shopModel = app::get('ome')->model('shop');
$shop_detail = $shopModel->dump(array('shop_id'=>$shop_id),'shop_type');
$shoptype = ome_shop_type::get_shop_type();
if($shop_detail['shop_type']){
return $shoptype[$shop_detail['shop_type']];
}else{
return '-';
}
}
/**
* 获取ShopType
* @param mixed $shop_type shop_type
* @return mixed 返回结果
*/
public function getShopType($shop_type){
$shoptype = ome_shop_type::get_shop_type();
return $shoptype[$shop_type];
}
}
?>