修改门店收款逻辑的操作

This commit is contained in:
liu 2024-06-27 16:12:02 +08:00
parent 10ed5f432c
commit cf3dc5d259
2 changed files with 14 additions and 1 deletions

View File

@ -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();

View File

@ -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');