feat: 更新了商店财务流水状态更新逻辑

This commit is contained in:
mkm 2024-06-28 18:52:55 +08:00
parent fa31930be6
commit aeff0c9d54

View File

@ -144,19 +144,17 @@ class StoreFinanceFlowLogic extends BaseLogic
*/
public function updateStatusStore($order_id, $store_id, $money, $deposit)
{
StoreFinanceFlow::where(['order_id' => $order_id, 'financial_pm' => 1, 'financial_type' => 11])->update(['status' => 1]);
StoreFinanceFlow::where(['order_id' => $order_id, 'financial_pm' => 1, 'financial_type' => 2])->update(['status' => 1]);
StoreFinanceFlow::where(['order_id' => $order_id,'financial_type' => 11])->update(['status' => 1]);
StoreFinanceFlow::where(['order_id' => $order_id,'financial_type' => 2])->update(['status' => 1]);
if ($money>0) {
SystemStore::where('id', $store_id)->inc('store_money', $money)->update();
}
if ($deposit>0) {
SystemStore::where('id', $store_id)->inc('paid_deposit', $deposit)->update();
}
$find = StoreFinanceFlow::where(['order_id' => $order_id, 'financial_pm' => 1, 'financial_type' => 16])->find();
$find = StoreFinanceFlow::where(['order_id' => $order_id, 'financial_pm' => 1, 'financial_type' => 16,'status'=>0])->find();
StoreFinanceFlow::where(['order_id' => $order_id,'financial_type' => 16])->update(['status' => 1]);
if ($find) {
$find->status=1;
$find->save();
if ($find['number'] > 0) {
SystemStore::where('id', $store_id)->inc('attrition', $find['number'])->update();
}