Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
纵之格
ShopXO
提交
859b634f
ShopXO
项目概览
纵之格
/
ShopXO
通知
394
Star
16
Fork
11
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
ShopXO
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
859b634f
编写于
1月 03, 2020
作者:
D
devil
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
插件调用优化
上级
f1674de4
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
34 addition
and
174 deletion
+34
-174
application/api/controller/Buy.php
application/api/controller/Buy.php
+10
-3
application/api/controller/Goods.php
application/api/controller/Goods.php
+12
-61
application/api/controller/Index.php
application/api/controller/Index.php
+11
-12
application/tags.php
application/tags.php
+0
-97
public/appmini/old/weixin/pages/goods-detail/goods-detail.js
public/appmini/old/weixin/pages/goods-detail/goods-detail.js
+1
-1
未找到文件。
application/api/controller/Buy.php
浏览文件 @
859b634f
...
...
@@ -14,6 +14,7 @@ use app\service\GoodsService;
use
app\service\UserService
;
use
app\service\PaymentService
;
use
app\service\BuyService
;
use
app\service\PluginsService
;
/**
* 购买
...
...
@@ -71,10 +72,16 @@ class Buy extends Common
'extension_data'
=>
$ret
[
'data'
][
'extension_data'
],
'common_order_is_booking'
=>
(
int
)
MyC
(
'common_order_is_booking'
,
0
),
'common_site_type'
=>
(
int
)
MyC
(
'common_site_type'
,
0
,
true
),
// 优惠劵
'plugins_coupon_data'
=>
CallPluginsServiceMethod
(
'coupon'
,
'BaseService'
,
'BuyUserCouponData'
,
[
'order_goods'
=>
$ret
[
'data'
][
'goods'
],
'coupon_id'
=>
$coupon_id
]),
];
// 优惠劵
$ret
=
PluginsService
::
PluginsControlCall
(
'coupon'
,
'coupon'
,
'buy'
,
'api'
,
[
'order_goods'
=>
$ret
[
'data'
][
'goods'
],
'coupon_id'
=>
$coupon_id
]);
if
(
$ret
[
'code'
]
==
0
&&
isset
(
$ret
[
'data'
][
'code'
])
&&
$ret
[
'data'
][
'code'
]
==
0
)
{
$result
[
'plugins_coupon_data'
]
=
$ret
[
'data'
][
'data'
];
}
return
DataReturn
(
'操作成功'
,
0
,
$result
);
}
return
$ret
;
...
...
application/api/controller/Goods.php
浏览文件 @
859b634f
...
...
@@ -12,6 +12,7 @@ namespace app\api\controller;
use
app\service\GoodsService
;
use
app\service\BuyService
;
use
app\service\PluginsService
;
use
app\service\GoodsCommentsService
;
/**
...
...
@@ -136,9 +137,6 @@ class Goods extends Common
// 站点模式
'common_site_type'
=>
(
int
)
MyC
(
'common_site_type'
,
0
,
true
),
'common_is_exhibition_mode_btn_text'
=>
MyC
(
'common_is_exhibition_mode_btn_text'
,
'立即咨询'
,
true
),
// 优惠劵
'plugins_coupon_data'
=>
$this
->
PluginsCouponGoods
(
$goods_id
),
];
// 支付宝小程序在线客服
...
...
@@ -148,56 +146,26 @@ class Goods extends Common
$result
[
'common_app_mini_alipay_scene'
]
=
MyC
(
'common_app_mini_alipay_scene'
,
null
,
true
);
}
// 秒杀
//
限时
秒杀
if
(
$result
[
'common_app_is_limitedtimediscount'
]
==
1
)
{
$ret
=
CallPluginsServiceMethod
(
'limitedtimediscount'
,
'Service'
,
'GoodsDetailCountdown'
,
$goods_id
);
if
(
$ret
[
'code'
]
==
0
)
$ret
=
PluginsService
::
PluginsControlCall
(
'limitedtimediscount'
,
'index'
,
'goods'
,
'api'
,
[
'goods_id'
=>
$goods_id
]);
if
(
$ret
[
'code'
]
==
0
&&
isset
(
$ret
[
'data'
][
'code'
])
&&
$ret
[
'data'
][
'code'
]
==
0
)
{
$result
[
'plugins_limitedtimediscount_data'
]
=
$ret
[
'data'
];
$result
[
'plugins_limitedtimediscount_data'
]
=
$ret
[
'data'
]
[
'data'
]
;
}
}
return
DataReturn
(
'success'
,
0
,
$result
);
}
/**
* 商品详情优惠劵
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2019-10-17
* @desc description
* @param [int] $goods_id [商品id]
*/
private
function
PluginsCouponGoods
(
$goods_id
)
{
// 获取基础配置信息
$base
=
CallPluginsData
(
'coupon'
);
// 优惠劵列表
$coupon_params
=
[
'where'
=>
[
'is_enable'
=>
1
,
'is_user_receive'
=>
1
,
],
'm'
=>
0
,
'n'
=>
0
,
'is_sure_receive'
=>
1
,
'user'
=>
$this
->
user
,
];
$ret
=
CallPluginsServiceMethod
(
'coupon'
,
'CouponService'
,
'CouponList'
,
$coupon_params
);
// 排除商品不支持的活动
if
(
!
empty
(
$ret
[
'data'
]))
// 优惠券
$ret
=
PluginsService
::
PluginsControlCall
(
'coupon'
,
'index'
,
'goods'
,
'api'
,
[
'goods_id'
=>
$goods_id
]);
if
(
$ret
[
'code'
]
==
0
&&
isset
(
$ret
[
'data'
][
'code'
])
&&
$ret
[
'data'
][
'code'
]
==
0
)
{
$re
t
[
'data'
]
=
CallPluginsServiceMethod
(
'coupon'
,
'BaseService'
,
'CouponListGoodsExclude'
,
[
'data'
=>
$ret
[
'data'
],
'goods_id'
=>
$goods_id
])
;
$re
sult
[
'plugins_coupon_data'
]
=
$ret
[
'data'
][
'data'
]
;
}
// 返回数据
return
[
'base'
=>
$base
[
'data'
],
'data'
=>
$ret
[
'data'
],
];
return
DataReturn
(
'success'
,
0
,
$result
);
}
/**
...
...
@@ -340,22 +308,5 @@ class Goods extends Common
];
return
DataReturn
(
'success'
,
0
,
$result
);
}
/**
* 商品海报
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-08-17T21:10:41+0800
*/
public
function
Poster
()
{
// 是否开启海报功能
if
(
MyC
(
'common_app_is_poster_share'
)
==
1
)
{
return
CallPluginsServiceMethod
(
'distribution'
,
'PosterGoodsService'
,
'GoodsCreateMiniWechat'
,
$this
->
data_post
);
}
return
DataReturn
(
'海报功能未启用'
,
-
100
);
}
}
?>
\ No newline at end of file
application/api/controller/Index.php
浏览文件 @
859b634f
...
...
@@ -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'
];
}
}
// 返回数据
...
...
application/tags.php
浏览文件 @
859b634f
...
...
@@ -32,102 +32,5 @@ return array (
'log_write'
=>
array
(
),
'plugins_css'
=>
array
(
0
=>
'app\\plugins\\membershiplevelvip\\Hook'
,
1
=>
'app\\plugins\\coupon\\Hook'
,
),
'plugins_service_navigation_header_handle'
=>
array
(
0
=>
'app\\plugins\\membershiplevelvip\\Hook'
,
1
=>
'app\\plugins\\coupon\\Hook'
,
),
'plugins_service_goods_handle_end'
=>
array
(
0
=>
'app\\plugins\\membershiplevelvip\\Hook'
,
),
'plugins_service_goods_spec_base'
=>
array
(
0
=>
'app\\plugins\\membershiplevelvip\\Hook'
,
),
'plugins_service_buy_handle'
=>
array
(
0
=>
'app\\plugins\\membershiplevelvip\\Hook'
,
1
=>
'app\\plugins\\coupon\\Hook'
,
),
'plugins_service_user_login_success_record'
=>
array
(
0
=>
'app\\plugins\\membershiplevelvip\\Hook'
,
),
'plugins_service_goods_spec_extends_handle'
=>
array
(
0
=>
'app\\plugins\\membershiplevelvip\\Hook'
,
),
'plugins_view_admin_user_save'
=>
array
(
0
=>
'app\\plugins\\membershiplevelvip\\Hook'
,
),
'plugins_service_user_save_handle'
=>
array
(
0
=>
'app\\plugins\\membershiplevelvip\\Hook'
,
),
'plugins_service_goods_save_handle'
=>
array
(
0
=>
'app\\plugins\\membershiplevelvip\\Hook'
,
),
'plugins_view_goods_detail_panel_price_top'
=>
array
(
0
=>
'app\\plugins\\membershiplevelvip\\Hook'
,
),
'plugins_view_home_goods_inside_bottom'
=>
array
(
0
=>
'app\\plugins\\membershiplevelvip\\Hook'
,
),
'plugins_view_search_goods_inside_bottom'
=>
array
(
0
=>
'app\\plugins\\membershiplevelvip\\Hook'
,
),
'plugins_service_goods_spec_type'
=>
array
(
0
=>
'app\\plugins\\membershiplevelvip\\Hook'
,
),
'plugins_service_users_center_left_menu_handle'
=>
array
(
0
=>
'app\\plugins\\membershiplevelvip\\Hook'
,
1
=>
'app\\plugins\\coupon\\Hook'
,
),
'plugins_service_header_navigation_top_right_handle'
=>
array
(
0
=>
'app\\plugins\\membershiplevelvip\\Hook'
,
1
=>
'app\\plugins\\coupon\\Hook'
,
),
'plugins_js'
=>
array
(
0
=>
'app\\plugins\\coupon\\Hook'
,
),
'plugins_view_goods_detail_panel_bottom'
=>
array
(
0
=>
'app\\plugins\\coupon\\Hook'
,
),
'plugins_view_buy_goods_bottom'
=>
array
(
0
=>
'app\\plugins\\coupon\\Hook'
,
),
'plugins_view_buy_form_inside'
=>
array
(
0
=>
'app\\plugins\\coupon\\Hook'
,
),
'plugins_service_buy_order_insert_success'
=>
array
(
0
=>
'app\\plugins\\coupon\\Hook'
,
),
'plugins_service_order_status_change_history_success_handle'
=>
array
(
0
=>
'app\\plugins\\coupon\\Hook'
,
),
'plugins_service_user_register_end'
=>
array
(
0
=>
'app\\plugins\\coupon\\Hook'
,
),
);
?>
\ No newline at end of file
public/appmini/old/weixin/pages/goods-detail/goods-detail.js
浏览文件 @
859b634f
...
...
@@ -800,7 +800,7 @@ Page({
}
else
{
wx
.
showLoading
({
title
:
'
生成中...
'
});
wx
.
request
({
url
:
app
.
get_request_url
(
'
poster
'
,
'
goods
'
),
url
:
app
.
get_request_url
(
'
poster
'
,
'
user
'
,
'
distribution
'
),
method
:
'
POST
'
,
data
:
{
"
goods_id
"
:
this
.
data
.
goods
.
id
},
dataType
:
'
json
'
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录