调整数据统计商品数量

This commit is contained in:
liaofei 2019-11-20 16:22:11 +08:00
parent 097a351a1b
commit a4dc1b3602
2 changed files with 6 additions and 4 deletions

View File

@ -58,7 +58,9 @@ class StoreStatistics extends BaseModel
public static function getOrderInfo($where)
{
$orderinfo = self::getTimeWhere($where)
->field('sum(total_price) total_price,sum(cost) cost,sum(pay_postage) pay_postage,sum(pay_price) pay_price,sum(coupon_price) coupon_price,sum(deduction_price) deduction_price,from_unixtime(pay_time,\'%Y-%m-%d\') pay_time')->order('pay_time')->group('from_unixtime(pay_time,\'%Y-%m-%d\')')->select()->toArray();
->field('sum(total_price) total_price,sum(cost) cost,sum(pay_postage) pay_postage,sum(pay_price) pay_price,sum(coupon_price) coupon_price,sum(deduction_price) deduction_price,from_unixtime(pay_time,\'%Y-%m-%d\') pay_time')
->order('pay_time')->where('paid',1)->where('refund_status',0)
->group('from_unixtime(pay_time,\'%Y-%m-%d\')')->select()->toArray();
$price = 0;
$postage = 0;
$deduction = 0;

View File

@ -288,10 +288,10 @@ class StoreProduct extends BaseModel
'class'=>'fa fa fa-ioxhost',
],
[
'name'=>'新增商品',
'name'=>'商品总数',
'field'=>'件',
'count'=>self::setWhereType(self::getModelTime($where,new self),$type)->where('is_new',1)->sum('stock'),
'content'=>'增商品总数',
'count'=>self::setWhereType(self::getModelTime($where,new self),$type)->sum('stock'),
'content'=>'增商品总数',
'background_color'=>'layui-bg-cyan',
'sum'=>self::where('is_new',1)->sum('stock'),
'class'=>'fa fa-line-chart',