小bug修复
This commit is contained in:
@@ -733,7 +733,14 @@ class Preaccept extends Base
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**预接收前对文章的支付信息,审核以及相关操作
|
||||
* @return \think\response\Json
|
||||
* @throws \think\Exception
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
* @throws \think\exception\PDOException
|
||||
*/
|
||||
public function getPreacceptPayment(){
|
||||
$data = $this->request->post();
|
||||
$rule = new Validate([
|
||||
@@ -744,28 +751,44 @@ class Preaccept extends Base
|
||||
}
|
||||
$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();
|
||||
if(intval($journal_info['fee'])==0||$article_info['ctime']<1735660800){
|
||||
if(intval($journal_info['fee'])==0||$article_info['ctime']<1735660800){//非收费期刊的文章直接返回
|
||||
$re['state'] = 1;
|
||||
$re['order'] = null;
|
||||
$re["fee"] = 0;
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
$order_info = $this->order_obj->where("article_id",$article_info['article_id'])->find();
|
||||
if($order_info['pay_type']==2){
|
||||
if($order_info==null){
|
||||
$re['state'] = 0;
|
||||
$re['order'] = null;
|
||||
$re["fee"] = 0;
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
// if($order_info['pay_type']==2){
|
||||
$paystation = $this->paystation_obj->where("ps_id",$order_info['ps_id'])->find();
|
||||
$order_info['paystation'] = $paystation;
|
||||
if($order_info['state']==0){
|
||||
$res = object_to_array(json_decode(paystationLookup($paystation['transaction_id'])));
|
||||
if(isset($res['result']['success'])&&$res['result']['success']){
|
||||
$this->article_obj->where("article_id",$order_info['article_id'])->update(['is_buy'=>1]);
|
||||
$this->order_obj->where("order_id",$order_info['order_id'])->update(['state'=>1]);
|
||||
$re['state'] = 1;
|
||||
$re['fee'] = $journal_info['fee'];
|
||||
$re['order'] = $order_info;
|
||||
return jsonSuccess($re);
|
||||
}else{
|
||||
$re['state'] = 0;
|
||||
$re['fee'] = $journal_info['fee'];
|
||||
$re['order'] = $order_info;
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
}else{
|
||||
$re['state'] = 1;
|
||||
$re['fee'] = $journal_info['fee'];
|
||||
$re['order'] = $order_info;
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
$order_info['paystation'] = $paystation;
|
||||
}
|
||||
$re['state'] = $order_info?$order_info['state']:$article_info['is_buy'];
|
||||
$re['fee'] = $journal_info['fee'];
|
||||
$re['order'] = $order_info;
|
||||
return jsonSuccess($re);
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user