切换导航条
此项目
正在载入...
登录
何书鹏
/
anttest
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
何书鹏
4 years ago
提交
3d9b8cee6fd4c2a175f3fc001aae41ec65a74db6
1 个父辈
f02205d9
商品接口
隐藏空白字符变更
内嵌
并排对比
正在显示
4 个修改的文件
包含
51 行增加
和
256 行删除
addons/shopro/model/Goods.php
application/api/controller/Goods.php
application/api/controller/Index.php
public/api.html
addons/shopro/model/Goods.php
查看文件 @
3d9b8ce
...
...
@@ -184,7 +184,10 @@ class Goods extends Model
'minute'
=>
0
,
'second'
=>
0
,
];
$soon_starttime
=
0
;
// 即将开抢时间
$soon_starttime
=
[
'hour'
=>
0
,
'minute'
=>
0
,
];
// 即将开抢时间
$tomorrow_start
=
strtotime
(
date
(
'Y-m-d'
,
strtotime
(
'+1 day'
)));
//明日开始时间
$tomorrow_end
=
strtotime
(
date
(
'Y-m-d'
,
strtotime
(
'+1 day'
)))
+
86400
;
//明日结束时间
$where
[
'type'
]
=
'seckill'
;
...
...
@@ -192,7 +195,7 @@ class Goods extends Model
$where
[
'endtime'
]
=
[
'>'
,
time
()];
$activity
=
Activity
::
where
(
$where
)
->
order
(
'starttime'
)
->
find
();
if
(
$activity
){
//本场
$type
=
'
1
'
;
$type
=
'
ing
'
;
// 本场倒计时
$lefttime
=
$activity
[
'endtime'
]
-
time
();
$current_endtime
=
[
...
...
@@ -205,13 +208,16 @@ class Goods extends Model
$where
[
'endtime'
]
=
[
'<'
,
$tomorrow_start
];
$activity
=
Activity
::
where
(
$where
)
->
order
(
'starttime'
)
->
find
();
if
(
$activity
){
$type
=
'2'
;
$soon_starttime
=
date
(
'H:i'
,
$activity
[
'starttime'
]);
$type
=
'nostart'
;
$soon_starttime
=
[
'hour'
=>
date
(
'H'
,
$activity
[
'starttime'
]),
'minute'
=>
date
(
'i'
,
$activity
[
'starttime'
]),
];
}
else
{
//明日预告
$where
[
'starttime'
]
=
[
'>'
,
$tomorrow_start
];
$where
[
'endtime'
]
=
[
'<'
,
$tomorrow_end
];
$activity
=
Activity
::
where
(
$where
)
->
order
(
'starttime'
)
->
find
();
$type
=
'
3
'
;
$type
=
'
tomorrow
'
;
}
}
$goodsList
=
[];
...
...
@@ -225,12 +231,15 @@ class Goods extends Model
// 首页拼团列表
public
static
function
indexGrouponGoodsList
()
{
$current_endtime
=
[
// 距本场结束时间
$current_endtime
=
[
'hour'
=>
0
,
'minute'
=>
0
,
'second'
=>
0
,
];
$soon_starttime
=
0
;
// 即将开抢时间
];
// 距本场结束时间
$soon_starttime
=
[
'hour'
=>
0
,
'minute'
=>
0
,
];
// 即将开抢时间
$tomorrow_start
=
strtotime
(
date
(
'Y-m-d'
,
strtotime
(
'+1 day'
)));
//明日开始时间
$tomorrow_end
=
strtotime
(
date
(
'Y-m-d'
,
strtotime
(
'+1 day'
)))
+
86400
;
//明日结束时间
$where
[
'type'
]
=
'groupon'
;
...
...
@@ -252,7 +261,10 @@ class Goods extends Model
$activity
=
Activity
::
where
(
$where
)
->
order
(
'starttime'
)
->
find
();
if
(
$activity
){
$type
=
'nostart'
;
$soon_starttime
=
date
(
'H:i'
,
$activity
[
'starttime'
]);
$soon_starttime
=
[
'hour'
=>
date
(
'H'
,
$activity
[
'starttime'
]),
'minute'
=>
date
(
'i'
,
$activity
[
'starttime'
]),
];
}
else
{
//明日预告
$where
[
'starttime'
]
=
[
'>'
,
$tomorrow_start
];
$where
[
'endtime'
]
=
[
'<'
,
$tomorrow_end
];
...
...
application/api/controller/Goods.php
查看文件 @
3d9b8ce
...
...
@@ -167,7 +167,12 @@ class Goods extends Base
"dispatch_type_arr": [
"express"
],
"service": [],
"service": [{ //服务标签
"id": 4, //标签ID
"name": "极速退款", //名称
"image": "http://api.7wpp.com/uploads/20200222/57d971eb5984317ee794e531ea0f9207.png", //图片
"description": "超快无审核退款流程" //描述
}],
"sku": [],
"coupons": []
}
...
...
application/api/controller/Index.php
查看文件 @
3d9b8ce
...
...
@@ -71,13 +71,16 @@ class Index extends Base
"image": "http://www.ant.top/uploads/20201221/559d2a240ec20b096590a902217009ff.png", //分类图片
}],
"seckill_list": {
"type": "1",
"current_endtime": {
"type": "ing", // 类型:ing=进行中,nostart=即将开始,tomorrow=明日预告
"current_endtime": { //距离本场结束
"hour": 10,
"minute": 12,
"second": 19
},
"soon_starttime": 0,
"soon_starttime": [ //即将开始时间
"hour": 14,
"minute": 00
],
"goodsList": [{
"id": 1, //商品ID
"type": "normal",
...
...
@@ -147,13 +150,16 @@ class Index extends Base
}]
},
"groupon_list": {
"type": "
1",
"type": "
ing", // 类型:ing=进行中,nostart=即将开始,tomorrow=明日预告
"current_endtime": {
"hour": 10,
"minute": 12,
"second": 19
},
"soon_starttime": 0,
"soon_starttime": [ //即将开始时间
"hour": 14,
"minute": 00
],
"goodsList":[{
"id": 2, //商品ID
"type": "normal",
...
...
public/api.html
查看文件 @
3d9b8ce
...
...
@@ -146,7 +146,7 @@
</div>
<a
href=
"#首页接口"
class=
"list-group-item"
data-toggle=
"collapse"
data-parent=
"#sidebar"
>
首页接口
<i
class=
"fa fa-caret-down"
></i></a>
<div
class=
"child collapse"
id=
"首页接口"
>
<a
href=
"javascript:;"
data-id=
"26"
class=
"list-group-item"
>
首页
</a>
<a
href=
"javascript:;"
data-id=
"26"
class=
"list-group-item"
>
@ApiWeigh (99)
</a>
<a
href=
"javascript:;"
data-id=
"27"
class=
"list-group-item"
>
上传文件
</a>
<a
href=
"javascript:;"
data-id=
"28"
class=
"list-group-item"
>
上传 base64 图片
</a>
</div>
...
...
@@ -649,7 +649,7 @@
<div
class=
"panel-heading"
id=
"heading-26"
>
<h4
class=
"panel-title"
>
<span
class=
"label label-success"
>
GET
</span>
<a
data-toggle=
"collapse"
data-parent=
"#accordion26"
href=
"#collapseOne26"
>
首页
<span
class=
"text-muted"
>
/api/index/index
</span></a>
<a
data-toggle=
"collapse"
data-parent=
"#accordion26"
href=
"#collapseOne26"
>
@ApiWeigh (99)
<span
class=
"text-muted"
>
/api/index/index
</span></a>
</h4>
</div>
<div
id=
"collapseOne26"
class=
"panel-collapse collapse"
>
...
...
@@ -667,28 +667,11 @@
<div
class=
"tab-pane active"
id=
"info26"
>
<div
class=
"well"
>
首页
</div>
@ApiWeigh (99)
</div>
<div
class=
"panel panel-default"
>
<div
class=
"panel-heading"
><strong>
Headers
</strong></div>
<div
class=
"panel-body"
>
<table
class=
"table table-hover"
>
<thead>
<tr>
<th>
名称
</th>
<th>
类型
</th>
<th>
必选
</th>
<th>
描述
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
token
</td>
<td>
string
</td>
<td>
否
</td>
<td>
请求的token
</td>
</tr>
</tbody>
</table>
无
</div>
</div>
<div
class=
"panel panel-default"
>
...
...
@@ -708,20 +691,9 @@
<div
class=
"row"
>
<div
class=
"col-md-12"
>
<div
class=
"panel panel-default"
>
<div
class=
"panel-heading"
><strong>
Headers
</strong></div>
<div
class=
"panel-body"
>
<div
class=
"headers"
>
<div
class=
"form-group"
>
<label
class=
"control-label"
for=
"token"
>
token
</label>
<input
type=
"string"
class=
"form-control input-sm"
id=
"token"
placeholder=
"请求的token - Ex: "
name=
"token"
>
</div>
</div>
</div>
</div>
<div
class=
"panel panel-default"
>
<div
class=
"panel-heading"
><strong>
参数
</strong></div>
<div
class=
"panel-body"
>
<form
enctype=
"application/x-www-form-urlencoded"
role=
"form"
action=
"/api/index/index"
method=
"
GET
"
name=
"form26"
id=
"form26"
>
<form
enctype=
"application/x-www-form-urlencoded"
role=
"form"
action=
"/api/index/index"
method=
"
get
"
name=
"form26"
id=
"form26"
>
<div
class=
"form-group"
>
无
</div>
...
...
@@ -756,212 +728,7 @@
<div
class=
"tab-pane"
id=
"sample26"
>
<div
class=
"row"
>
<div
class=
"col-md-12"
>
<pre
id=
"sample_response26"
>
{
"code": 1,
"msg": "优惠券中心",
"time": "1607909742",
"data": [{
"id": 1, //优惠券ID
"name": "满100减10", //优惠券名称
"type": "cash",
"goods_ids": "0",
"amount": "10.00", //减免金额
"enough": "100.00", //使用门槛
"stock": 0, //剩余券数量
"limit": 1, //每人限领
"gettime": {
"start": 1607875200,
"end": 1610640000
},
"usetime": { //有效期
"start": "2020.12.18", //开始时间
"end": "2021.01.30" //结束时间
},
"description": "满100减10", //优惠券描述
"usetimestart": 1608220800,
"usetimeend": 1611936000,
"gettimestart": 1607875200,
"gettimeend": 1610640000,
"user_coupons_id": 1, //领取ID
"status_code": 1610640000, //状态码:no_use=未使用,used=已使用,expired=已过期
"status_name": "未使用" //状态名称
}]
}{
"code": 1,
"msg": "首页",
"time": "1608036399",
"data": {
"banner_list": [{ //轮播图
"id": 3, //轮播图ID
"image": "http://www.ant.top/uploads/20201214/b655ea4dc4779222ab7a4e2b95feb3a4.png" //图片地址
}],
"category_list": [{ //一级分类
"id": 1, //分类ID
"name": "商品分类", //分类名称
"image": "http://www.ant.top/uploads/20201221/559d2a240ec20b096590a902217009ff.png", //分类图片
}],
"seckill_list": {
"type": "1",
"current_endtime": {
"hour": 10,
"minute": 12,
"second": 19
},
"soon_starttime": 0,
"goodsList": [{
"id": 1, //商品ID
"type": "normal",
"title": "测试商品", //标题
"subtitle": "测试啊", //副标题
"weigh": 0,
"category_ids": "3", //所属分类ID
"image": "http://www.ant.top/assets/img/qrcode.png", //商品主图
"price": "0.01", //商品价格
"original_price": "10000.00", //原价
"is_sku": 0,
"likes": 0,
"views": 3,
"sales": 0, //销量
"show_sales": 0, //显示销量
"dispatch_type": "express",
"dispatch_ids": "1",
"deletetime": null,
"activity": {
"id": 7,
"title": "秒杀测试",
"type": "seckill",
"richtext_id": 0,
"richtext_title": "",
"starttime": 1607616000,
"endtime": 1607702400,
"rules": {
"limit_buy": "1",
"order_auto_close": "",
"activity_auto_close": ""
}
},
"activity_type": "seckill",
"sku_price": [{
"id": 1,
"goods_sku_ids": null,
"goods_id": 1,
"weigh": 0,
"image": null,
"stock": 20,
"sales": 0,
"sn": "",
"weight": 0,
"price": "0.01",
"goods_sku_text": null,
"status": "up",
"activity_type": "seckill",
"activity_id": 7,
"item_goods_sku_price": {
"id": 4,
"activity_id": 7,
"sku_price_id": 1,
"goods_id": 1,
"stock": 20,
"sales": 0,
"price": "0.01",
"status": "up"
},
"goods_sku_id_arr": [
""
]
}],
"stock": 20,
"dispatch_type_arr": [
"express"
]
}]
},
"groupon_list": {
"type": "1",
"current_endtime": {
"hour": 10,
"minute": 12,
"second": 19
},
"soon_starttime": 0,
"goodsList":[{
"id": 2, //商品ID
"type": "normal",
"title": "测试商品2", //商品标题
"subtitle": "测试啊啊", //商品副标题
"weigh": 0,
"category_ids": "3",
"image": "http://www.ant.top/uploads/20201211/8894d62100f2f920ffb2f38063b63f2d.jpg", //商品主图
"price": "0.02", //现价
"original_price": "1000.00", //原价
"is_sku": 0, //是否多规格:0=否,1=是
"likes": 0,
"views": 1,
"sales": 0,
"show_sales": 0, //显示销量
"dispatch_type": "express",
"dispatch_ids": "1",
"deletetime": null,
"activity": {
"id": 9, //活动ID
"title": "拼团测试", //活动标题
"type": "groupon", //活动类型:seckill=秒杀,groupon=拼团
"richtext_id": 0,
"richtext_title": "",
"starttime": 1607616000,
"endtime": 1607702400,
"rules": { //活动规则
"limit_buy": "1", //每人限购件数
"order_auto_close": "",
"activity_auto_close": "",
"team_num": "2", //成团人数
"is_alone": "0", //是否允许单独购买
"is_fictitious": "0",
"fictitious_num": "",
"valid_time": "",
"team_card": "0"
}
},
"activity_type": "groupon",
"groupon_price": "0.01",
"sku_price": [{
"id": 2,
"goods_sku_ids": null,
"goods_id": 2,
"weigh": 0,
"image": null,
"stock": 10,
"sales": 0,
"sn": "",
"weight": 0,
"price": "0.02",
"goods_sku_text": null,
"status": "up",
"groupon_price": "0.01",
"activity_type": "groupon",
"activity_id": 9,
"item_goods_sku_price": {
"id": 5,
"activity_id": 9,
"sku_price_id": 2,
"goods_id": 2,
"stock": 10,
"sales": 0,
"price": "0.01",
"status": "up"
},
"goods_sku_id_arr": [
""
]
}],
"stock": 10,
"dispatch_type_arr": [
"express"
]
}]
}
}
}
</pre>
<pre
id=
"sample_response26"
>
无
</pre>
</div>
</div>
</div>
<!-- #sample -->
...
...
@@ -7157,7 +6924,12 @@
"dispatch_type_arr": [
"express"
],
"service": [],
"service": [{ //服务标签
"id": 4, //标签ID
"name": "极速退款", //名称
"image": "http://api.7wpp.com/uploads/20200222/57d971eb5984317ee794e531ea0f9207.png", //图片
"description": "超快无审核退款流程" //描述
}],
"sku": [],
"coupons": []
}
...
...
@@ -10316,7 +10088,7 @@
<div
class=
"row mt0 footer"
>
<div
class=
"col-md-6"
align=
"left"
>
Generated on 2020-12-21 1
1:29:0
0
</div>
Generated on 2020-12-21 1
6:56:1
0
</div>
<div
class=
"col-md-6"
align=
"right"
>
<a
href=
"./"
target=
"_blank"
>
My Website
</a>
</div>
...
...
请
注册
或
登录
后发表评论