mirror of
https://gitee.com/zongzhige/shopxo.git
synced 2026-06-07 10:22:38 +08:00
插件调用优化
This commit is contained in:
@ -13,6 +13,7 @@ namespace app\api\controller;
|
||||
use app\service\GoodsService;
|
||||
use app\service\BannerService;
|
||||
use app\service\AppHomeNavService;
|
||||
use app\service\PluginsService;
|
||||
|
||||
/**
|
||||
* 首页
|
||||
@ -45,9 +46,6 @@ class Index extends Common
|
||||
*/
|
||||
public function Index()
|
||||
{
|
||||
// 秒杀
|
||||
$common_app_is_limitedtimediscount = (int) MyC('common_app_is_limitedtimediscount');
|
||||
|
||||
// 返回数据
|
||||
$result = [
|
||||
'navigation' => AppHomeNavService::AppHomeNav(),
|
||||
@ -57,8 +55,8 @@ class Index extends Common
|
||||
'common_app_is_enable_search' => (int) MyC('common_app_is_enable_search', 1),
|
||||
'common_app_is_enable_answer' => (int) MyC('common_app_is_enable_answer', 1),
|
||||
'common_app_is_header_nav_fixed' => (int) MyC('common_app_is_header_nav_fixed', 0),
|
||||
'common_app_is_online_service' => (int) MyC('common_app_is_online_service', 0),
|
||||
'common_app_is_limitedtimediscount' => $common_app_is_limitedtimediscount,
|
||||
'common_app_is_online_service' => (int) MyC('common_app_is_online_service', 0),
|
||||
'common_app_is_limitedtimediscount' => (int) MyC('common_app_is_limitedtimediscount'),
|
||||
];
|
||||
|
||||
// 支付宝小程序在线客服
|
||||
@ -68,14 +66,15 @@ class Index extends Common
|
||||
$result['common_app_mini_alipay_scene'] = MyC('common_app_mini_alipay_scene', null, true);
|
||||
}
|
||||
|
||||
// 秒杀
|
||||
if($common_app_is_limitedtimediscount == 1)
|
||||
// 限时秒杀
|
||||
if($result['common_app_is_limitedtimediscount'] == 1)
|
||||
{
|
||||
$ret = CallPluginsServiceMethod('limitedtimediscount', 'Service', 'ApiHomeAd');
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
$result['plugins_limitedtimediscount_data'] = $ret['data'];
|
||||
}
|
||||
$ret = PluginsService::PluginsControlCall(
|
||||
'limitedtimediscount', 'index', 'index', 'api');
|
||||
if($ret['code'] == 0 && isset($ret['data']['code']) && $ret['data']['code'] == 0)
|
||||
{
|
||||
$result['plugins_limitedtimediscount_data'] = $ret['data']['data'];
|
||||
}
|
||||
}
|
||||
|
||||
// 返回数据
|
||||
|
||||
Reference in New Issue
Block a user