You've already forked guangan
商品Address
This commit is contained in:
46
plugs/think-plugs-points-mall/src/helper.php
Normal file
46
plugs/think-plugs-points-mall/src/helper.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
// +----------------------------------------------------------------------
|
||||
// | WeMall Plugin for ThinkAdmin
|
||||
// +----------------------------------------------------------------------
|
||||
// | 版权所有 2022~2024 ThinkAdmin [ thinkadmin.top ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网站: https://thinkadmin.top
|
||||
// +----------------------------------------------------------------------
|
||||
// | 免责声明 ( https://thinkadmin.top/disclaimer )
|
||||
// | 会员免费 ( https://thinkadmin.top/vip-introduce )
|
||||
// +----------------------------------------------------------------------
|
||||
// | gitee 代码仓库:https://gitee.com/zoujingli/think-plugs-wemall
|
||||
// | github 代码仓库:https://github.com/zoujingli/think-plugs-wemall
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
declare (strict_types=1);
|
||||
|
||||
if (!function_exists('show_gspec')) {
|
||||
/**
|
||||
* 商品规格过滤显示
|
||||
* @param string $spec 原规格内容
|
||||
* @return string
|
||||
*/
|
||||
function show_gspec(string $spec): string
|
||||
{
|
||||
$specs = [];
|
||||
foreach (explode(';;', $spec) as $sp) {
|
||||
$specs[] = explode('::', $sp)[1];
|
||||
}
|
||||
return join(' ', $specs);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!function_exists('formatdate')) {
|
||||
/**
|
||||
* 日期格式过滤
|
||||
* @param string|null $value
|
||||
* @return string|null
|
||||
*/
|
||||
function formatdate(?string $value): ?string
|
||||
{
|
||||
return is_string($value) ? str_replace(['年', '月', '日'], ['-', '-', ''], $value) : $value;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user