Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
liexin_supplier
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
3bfebb71
authored
Jun 03, 2026
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修复过期展示
parent
51a41fc3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
3 deletions
app/Http/Services/SkuService.php
config/field.php
resources/views/web/sku/SkuListFilter.blade.php
app/Http/Services/SkuService.php
View file @
3bfebb71
...
...
@@ -83,7 +83,12 @@ class SkuService extends BaseService
$sku
[
'audit_user'
]
=
$auditData
[
$goodsId
][
'audit_name'
];
}
// 按SKU上架有效期是否超过当前时间计算是否过期
$sku
[
'is_expire'
]
=
(
!
empty
(
$sku
[
'cp_time'
])
&&
$sku
[
'cp_time'
]
<
time
())
?
1
:
0
;
if
(
empty
(
$sku
[
'cp_time'
]))
{
$sku
[
'is_expire'
]
=
-
1
;
}
else
{
$sku
[
'is_expire'
]
=
(
!
empty
(
$sku
[
'cp_time'
])
&&
$sku
[
'cp_time'
]
<
time
())
?
1
:
0
;
}
$spu
=
json_decode
(
$spuRedis
->
hget
(
'spu'
,
$sku
[
'spu_id'
]),
true
);
$sku
[
'spu_name'
]
=
$spu
[
'spu_name'
];
//型号处理
...
...
@@ -160,7 +165,7 @@ class SkuService extends BaseService
$item
[
'moq'
]
=
$item
[
'moq'
]
?:
0
;
$item
[
'stock'
]
=
$item
[
'stock'
]
?:
0
;
$item
[
'cp_time'
]
=
$item
[
'cp_time'
]
?
date
(
'Y-m-d H:i:s'
,
$item
[
'cp_time'
])
:
''
;
$item
[
'is_expire_name'
]
=
!
empty
(
$item
[
'is_expire'
])
?
'是'
:
'否'
;
$item
[
'is_expire_name'
]
=
array_get
(
config
(
'field.SkuIsExpire'
),
$item
[
'is_expire'
],
''
)
;
$goodsTag
=
$redis
->
hget
(
'goods_tag'
,
$item
[
'goods_id'
]);
$goodsTag
=
$goodsTag
?
json_decode
(
$goodsTag
,
true
)
:
''
;
$item
[
'sku_tags'
]
=
$goodsTag
?
array_get
(
$goodsTag
,
'customer_tag'
)
:
''
;
...
...
config/field.php
View file @
3bfebb71
...
...
@@ -408,4 +408,9 @@ return [
'陈雪梅'
,
'李新华'
,
],
'SkuIsExpire'
=>
[
0
=>
'未过期'
,
1
=>
'已过期'
,
-
1
=>
''
],
];
resources/views/web/sku/SkuListFilter.blade.php
View file @
3bfebb71
...
...
@@ -141,7 +141,7 @@
</div>
<div
class=
"layui-inline"
>
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('is_expire','是否过期',request()->get('is_expire'),[-1=>'
否',1=>'是
']) !!}
{!! $statusPresenter->render('is_expire','是否过期',request()->get('is_expire'),[-1=>'
',1=>'是',0=>'否
']) !!}
</div>
<div
class=
"layui-inline"
>
@inject('statusPresenter','App\Presenters\StatusPresenter')
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment