细节优化

This commit is contained in:
gongfuxiang 2022-08-11 11:34:02 +08:00
parent c9664d0eca
commit 96c278756c
4 changed files with 31 additions and 37 deletions

View File

@ -208,7 +208,7 @@
{{if isset($is_income) and $is_income eq true}}
<li>
<div class="li-content">
<p class="name">收入总计</p>
<p class="name">订单总计</p>
<p class="total animation-count-to base-order-complete-total" data-to="{{$base_count.order_complete_total}}" data-speed="1500" data-decimals="2">0.00</p>
<div class="item am-margin-bottom-xs">
<span>上月</span>

View File

@ -30,7 +30,7 @@ use app\service\AppService;
class Goods extends Common
{
/**
* [__construct 构造方法]
* 构造方法
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1

View File

@ -575,25 +575,22 @@ class StatisticalService
$data = [];
$value_arr = [];
$name_arr = [];
if(!empty($status_arr))
$date = self::DayCreate($params['start'], $params['end']);
foreach($date as $day)
{
$date = self::DayCreate($params['start'], $params['end']);
foreach($date as $day)
{
// 当前日期名称
$name_arr[] = date('Y-m-d', $day['start']);
// 当前日期名称
$name_arr[] = date('Y-m-d', $day['start']);
// 根据状态获取数量
foreach($status_arr as $status)
{
// 获取订单
$where = [
['status', '=', $status],
['add_time', '>=', $day['start']],
['add_time', '<=', $day['end']],
];
$value_arr[$status][] = Db::name('Order')->where($where)->count();
}
// 根据状态获取数量
foreach($status_arr as $status)
{
// 获取订单
$where = [
['status', '=', $status],
['add_time', '>=', $day['start']],
['add_time', '<=', $day['end']],
];
$value_arr[$status][] = Db::name('Order')->where($where)->count();
}
}
@ -639,25 +636,22 @@ class StatisticalService
// 订单收入总计、是否有收入统计权限
if(AdminIsPower('index', 'income'))
{
if(!empty($status_arr))
$date = self::DayCreate($params['start'], $params['end']);
foreach($date as $day)
{
$date = self::DayCreate($params['start'], $params['end']);
foreach($date as $day)
{
// 当前日期名称
$name_arr[] = date('Y-m-d', $day['start']);
// 当前日期名称
$name_arr[] = date('Y-m-d', $day['start']);
// 根据状态获取数量
foreach($status_arr as $status)
{
// 获取订单
$where = [
['status', '=', $status],
['add_time', '>=', $day['start']],
['add_time', '<=', $day['end']],
];
$value_arr[$status][] = Db::name('Order')->where($where)->sum('pay_price');
}
// 根据状态获取数量
foreach($status_arr as $status)
{
// 获取订单
$where = [
['status', '=', $status],
['add_time', '>=', $day['start']],
['add_time', '<=', $day['end']],
];
$value_arr[$status][] = Db::name('Order')->where($where)->sum('pay_price');
}
}

View File

@ -62,7 +62,7 @@ class ThemeService
$default_preview = __MY_PUBLIC_URL__.'static'.DS.'common'.DS.'images'.DS.'default-preview.jpg';
while(($temp_file = readdir($dh)) !== false)
{
if(substr($temp_file, 0, 1) == '.' || in_array($temp_file, ['index.html']))
if(substr($temp_file, 0, 1) == '.' || in_array($temp_file, ['index.html']) || is_dir($temp_file))
{
continue;
}