调整商户押金记录

This commit is contained in:
luofei 2024-03-09 16:50:09 +08:00
parent fc78d3af34
commit ca00b1ab27
2 changed files with 7 additions and 7 deletions

View File

@ -405,14 +405,14 @@ class StoreOrder extends BaseController
return app('json')->success($list);
}
/**
* 获取商户押金列表
*/
public function getOrderAutoMarginList($merId){
[$page, $limit] = $this->getPage();
$select= Db::name('financial_record')->where('mer_id',$merId)->where('type',1)
->where('financial_type','auto_margin')->where('financial_pm',0)
$select= Db::name('financial_record')->where('mer_id',$merId)
->where('financial_type','auto_margin')
->page($page)->limit($limit)->order('financial_record_id','desc')->select();
return app('json')->success($select);

View File

@ -301,10 +301,10 @@ class Merchant extends BaseController
if (empty($merchantInfo)) {
return app('json')->fail('参数错误');
}
$margin = Db::name('MerchantType')->where('mer_type_id', $merchantInfo['type_id'])->value('margin');
$merchantInfo['unpaid_margin'] = bcsub($margin, $merchantInfo['paid_margin'], 2);
if ($merchantInfo['margin'] == 0) {
$merchantInfo['margin'] = $merchantInfo['unpaid_margin'];
$merchantInfo['unpaid_margin'] = bcsub($merchantInfo['margin'], $merchantInfo['paid_margin'], 2);
if ($merchantInfo['margin'] <= 0) {
$merchantInfo['unpaid_margin'] = 0;
$merchantInfo['paid_margin'] = 0;
}
return app('json')->success($merchantInfo);
}