修復bug
This commit is contained in:
@@ -230,14 +230,22 @@ 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'];
|
||||
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();
|
||||
|
||||
|
||||
@@ -751,10 +751,14 @@ class Preaccept extends Base
|
||||
return jsonError($rule->getError());
|
||||
}
|
||||
$article_info = $this->article_obj->where("article_id",$data['article_id'])->find();
|
||||
$journal_info = $this->journal_obj->where("journal_id",$article_info['journal_id'])->find();
|
||||
$order_info = $this->order_obj->where("article_id",$article_info['article_id'])->find();
|
||||
$order_info['paystation'] = $this->paystation_obj->where("ps_id",$order_info['ps_id'])->find();
|
||||
$re['state'] = $article_info['is_buy'];
|
||||
$re['order'] = $order_info;
|
||||
$re["fee"] = $article_info['fee'];
|
||||
$re['article'] = $article_info;
|
||||
$re['journal'] = $journal_info;
|
||||
return jsonSuccess($re);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user