当存在有效的 id 时,更新 opurchase_goods_offer_date 表中的 status 为 1

This commit is contained in:
mkm 2024-05-25 19:12:42 +08:00
parent afc5defd6f
commit e5115f374b

View File

@ -19,6 +19,15 @@ class OpurchaseGoodsOfferLogic extends BaseLogic{
'update_time' => time()
]);
}
$id=$params['data'][0]['id']??0;
if($id){
$find=OpurchaseGoodsOffer::where('id',$params['data'][0]['id'])->field('supplier_id','create_time')->find();
if($find){
$time=date('Y-m-d',$find['create_time']);
Db::name('opurchase_goods_offer_date')->where('supplier_id', $find['supplier_id'])->whereDay('create_time',$time)->update(['status'=>1]);
}
}
Db::commit();
return true;
} catch (\Exception $e) {