修復bug

This commit is contained in:
wangjinlei
2025-11-25 14:28:08 +08:00
parent 4298ec83c6
commit 539694abc5
2 changed files with 14 additions and 2 deletions

View File

@@ -230,15 +230,23 @@ class Order extends base{
// 更新文章费用信息
$article_update['fee']=$data['fee'];
$article_update['fee_remark']=$data['fee_remark'];
if(intval($data['fee'])==0) {
$article_update['is_buy']=1;
}
$this->article_obj->where("article_id",$data['article_id'])->update($article_update);
// 如果存在未完成的订单,则同步更新订单费用
$order_info = $this->order_obj->where("article_id",$data['article_id'])->whereIn("state",[0,1])->find();
if($order_info){
$update1['fee']=$data['fee'];
$this->order_obj->where("order_id",$order_info['order_id'])->update($update1);
if(intval($data['fee'])==0){
$this->order_obj->where("order_id",$order_info['order_id'])->update(['state'=>2]);
}else{
$update1['order_fee']=$data['fee'];
$this->order_obj->where("order_id",$order_info['order_id'])->update($update1);
}
}
return jsonSuccess();
}