Merge branch 'dev' of https://gitea.lihaink.cn/mkm/multi-store into dev
This commit is contained in:
commit
be035be2f5
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace app\common\logic;
|
namespace app\common\logic;
|
||||||
|
|
||||||
|
use app\common\enum\YesNoEnum;
|
||||||
use app\common\model\store_cash_finance_flow\StoreCashFinanceFlow;
|
use app\common\model\store_cash_finance_flow\StoreCashFinanceFlow;
|
||||||
|
|
||||||
class CashFlowLogic extends BaseLogic
|
class CashFlowLogic extends BaseLogic
|
||||||
@ -13,6 +14,7 @@ class CashFlowLogic extends BaseLogic
|
|||||||
$model->store_id = $storeId;
|
$model->store_id = $storeId;
|
||||||
$model->cash_price = $amount;
|
$model->cash_price = $amount;
|
||||||
$model->receivable = $amount;
|
$model->receivable = $amount;
|
||||||
|
$model->status = YesNoEnum::YES;//收银台收了默认算完成了
|
||||||
$model->save();
|
$model->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -548,34 +548,37 @@ class WorkbenchLogic extends BaseLogic
|
|||||||
public static function revenueStatistics($params)
|
public static function revenueStatistics($params)
|
||||||
{
|
{
|
||||||
|
|
||||||
//当日营业额的统计 当日利润的统计 当日成本合集的统计 当日加到保证金的 当日的现金收银
|
//当日营业额的统计
|
||||||
$today = StoreOrder::where(['paid'=>YesNoEnum::YES,'store_id'=>$params['store_id']]);
|
$today = StoreOrder::where(['paid'=>YesNoEnum::YES,'store_id'=>$params['store_id']]);
|
||||||
$turnover_today = $today
|
$turnover_today = $today
|
||||||
->whereDay('create_time')
|
->whereDay('create_time')
|
||||||
->sum('pay_price');
|
->sum('pay_price');
|
||||||
|
//当日利润的统计
|
||||||
$profit_today = $today
|
$profit_today = $today
|
||||||
->whereDay('create_time')
|
->whereDay('create_time')
|
||||||
->sum('profit');
|
->sum('profit');
|
||||||
|
//当日成本合集的统计
|
||||||
$cost_today = $today
|
$cost_today = $today
|
||||||
->whereDay('create_time')
|
->whereDay('create_time')
|
||||||
->sum('cost');
|
->sum('cost');
|
||||||
|
|
||||||
$deposit = StoreFinanceFlow::where(['store_id'=>$params['store_id']])
|
//当日加到保证金的
|
||||||
|
$deposit = StoreFinanceFlow::where(['store_id'=>$params['store_id'],'status'=>YesNoEnum::YES])
|
||||||
->where('financial_type',OrderEnum::ORDER_MARGIN);
|
->where('financial_type',OrderEnum::ORDER_MARGIN);
|
||||||
$deposit_today =$deposit
|
$deposit_today =$deposit
|
||||||
->whereDay('create_time')
|
->whereDay('create_time')
|
||||||
->sum('number');
|
->sum('number');
|
||||||
|
//当日的现金收银
|
||||||
$cash_today = StoreCashFinanceFlow::where('store_id',$params['store_id'])
|
$cash_today = StoreCashFinanceFlow::where('store_id',$params['store_id'])
|
||||||
->whereDay('create_time')
|
->whereDay('create_time')
|
||||||
->where('status',YesNoEnum::YES)
|
->where('status',YesNoEnum::YES)
|
||||||
->sum('receipts');
|
->sum('receivable');
|
||||||
|
|
||||||
//总的营业额的统计 总的利润的统计 总的成本合集的统计 总的加到保证金的
|
//总的营业额的统计 总的利润的统计 总的成本合集的统计 总的加到保证金的
|
||||||
$all = StoreOrder::where(['paid'=>YesNoEnum::YES,'store_id'=>$params['store_id']]);
|
$all = StoreOrder::where(['paid'=>YesNoEnum::YES,'store_id'=>$params['store_id']]);
|
||||||
|
|
||||||
$deposit_all = SystemStore::where('id',$params['store_id'])
|
$deposit_all = StoreFinanceFlow::where(['store_id'=>$params['store_id'],'status'=>YesNoEnum::YES])
|
||||||
->value('paid_deposit');
|
->sum('number');
|
||||||
|
|
||||||
$cash_all = StoreCashFinanceFlow::where('store_id',$params['store_id'])
|
$cash_all = StoreCashFinanceFlow::where('store_id',$params['store_id'])
|
||||||
->where('status',YesNoEnum::YES)
|
->where('status',YesNoEnum::YES)
|
||||||
@ -590,7 +593,7 @@ class WorkbenchLogic extends BaseLogic
|
|||||||
$cash_all = StoreCashFinanceFlow::where('store_id',$params['store_id'])
|
$cash_all = StoreCashFinanceFlow::where('store_id',$params['store_id'])
|
||||||
->where('status',YesNoEnum::YES)
|
->where('status',YesNoEnum::YES)
|
||||||
->whereMonth('create_time', $params['month'])
|
->whereMonth('create_time', $params['month'])
|
||||||
->sum('receipts');
|
->sum('receivable');
|
||||||
}
|
}
|
||||||
$turnover_all = $all
|
$turnover_all = $all
|
||||||
->sum('pay_price');
|
->sum('pay_price');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user