修改门店收款逻辑的操作
This commit is contained in:
parent
10ed5f432c
commit
cf3dc5d259
@ -67,6 +67,18 @@ class OrderLogic extends BaseLogic
|
||||
return bcadd($todayAmount, $pay_price, 2);
|
||||
}
|
||||
|
||||
public static function dealFlexiblePrice($where,$start,$end)
|
||||
{
|
||||
$todayAmount = UserRecharge::where($where)
|
||||
->whereBetweenTime('create_time', $start, $end)
|
||||
->sum('price');
|
||||
$pay_price = StoreOrder::where($where)
|
||||
->whereBetweenTime('create_time', $start, $end)
|
||||
->sum('pay_price');
|
||||
return bcadd($todayAmount, $pay_price, 2);
|
||||
|
||||
}
|
||||
|
||||
public static function sales($where,$time){
|
||||
$select=StoreOrder::where($where)->whereDay('create_time',$time)->limit(10)->order('id desc')->field('id,order_id,pay_price,create_time')->select();
|
||||
return $select?->toArray();
|
||||
|
@ -84,7 +84,8 @@ class WorkbenchLogic extends BaseLogic
|
||||
$data['income_amount'] = StoreFinanceFlow::where($storeFinanceWhere)->whereBetweenTime('create_time', $startTime, $endTime)->sum('number');
|
||||
//门店收款金额
|
||||
$all_where['paid'] = 1;
|
||||
$data['receipt_amount'] = OrderLogic::dayPayPrice($all_where,date('Y-m-d',time()));
|
||||
// $data['receipt_amount'] = OrderLogic::dayPayPrice($all_where,date('Y-m-d',time()));
|
||||
$data['receipt_amount'] = OrderLogic::dealFlexiblePrice($all_where,$startTime,$endTime);
|
||||
// $data['receipt_amount'] = UserRecharge::where($userRechargeWhere)->whereBetweenTime('create_time', $startTime, $endTime)->sum('price');
|
||||
//保证金金额
|
||||
$data['deposit_amount'] = StoreFinanceFlow::where($storeFinanceWhereTwo)->whereBetweenTime('create_time', $startTime, $endTime)->sum('number');
|
||||
|
Loading…
x
Reference in New Issue
Block a user