问题说明:总平台里门店财务记录中可提现金额显示中未减掉已提现金额
修改文件:app/services/store/finance/StoreExtractServices.php
修改方法:index()
public function index(array $where, array $whereData = [])
{
$list = $this->getStoreExtractList($where);
//待审核金额
$where['status'] = 0;
$extract_statistics['price'] = $this->dao->getExtractMoneyByWhere($where, 'extract_price');
//待转账金额
$where['status'] = 1;
$where['pay_status'] = 0;
$extract_statistics['unPayPrice'] = $this->dao->getExtractMoneyByWhere($where, 'extract_price');
//累计提现
$where['status'] = 1;
$where['pay_status'] = 1;
$extract_statistics['paidPrice'] = $this->dao->getExtractMoneyByWhere($where, 'extract_price');
$extract_statistics['price_count'] = 0;
//未提现金额
/** @var StoreFinanceFlowServices $storeFinanceFlowServices */
$storeFinanceFlowServices = app()->make(StoreFinanceFlowServices::class);
$whereData['is_take'] = 1;
$price_not = $storeFinanceFlowServices->getSumFinance(['store_id' => isset($where['store_id']) && $where['store_id'] ? $where['store_id'] : ''], $whereData);
$extract_statistics['price_not'] = max($price_not, 0);
//冻结中金额
$whereData['is_take'] = 0;
$freeze_price = $storeFinanceFlowServices->getFreezeSumFinance($whereData);
$extract_statistics['freeze_price'] = max($freeze_price, 0);
$extract_statistics['extract_min_price'] = sys_config('store_extract_min_price');
$extract_statistics['extract_max_price'] = sys_config('store_extract_max_price');
return compact('extract_statistics', 'list');
}修改文件:app/model/store/finance/StoreExtract.php
修改方法:searchStoreIdAttr()
public function searchStoreIdAttr($query, $value)
{
if (is_array($value)) {
if ($value) $query->whereIn('store_id', $value);
} else {
if ($value) $query->where('store_id', $value);
}
}
