Commit de8cc129 authored by zhuwei's avatar zhuwei

是否有支付过

parent 4bd44892
...@@ -402,9 +402,9 @@ class AmercementService ...@@ -402,9 +402,9 @@ class AmercementService
public function cancelAmercement($id) public function cancelAmercement($id)
{ {
//判断是否有支付过 //判断是否有支付过
$payInfo = $this->isPay($id, -1); $payInfo = $this->isPay($id);
if ($payInfo) {//有支付订单号 不允许取消 if ($payInfo) {//已支付 不允许取消
return ['code' => 101, 'msg' => '失败!该罚款有支付订单']; return ['code' => 101, 'msg' => '失败!该罚款已支付'];
} else {//无支付订单号 允许取消 } else {//无支付订单号 允许取消
$data = []; $data = [];
$data['id'] = $id; $data['id'] = $id;
...@@ -446,11 +446,11 @@ class AmercementService ...@@ -446,11 +446,11 @@ class AmercementService
*/ */
public function isPay($amercement_id, $status = 1) public function isPay($amercement_id, $status = 1)
{ {
$amercementPayModel = new OAmercementPayModel(); $amercementPayModel = new OAmercementPayModel();
$where["amercement_id"] = $amercement_id; $where["amercement_id"] = $amercement_id;
$where["status"] = $status; $where["status"] = $status;//支付状态 0待付款 1已支付 2 支付失败 3支付中
if ($status == -1) { if ($status == -1) {
$where["status"] = array('neq', 2);//排除支付失败的 $where["status"] = array( 'neq', 2 );//排除支付失败的
} }
$payInfo = $amercementPayModel->getAmercementPayInfo($where, "id,status,trade_no"); $payInfo = $amercementPayModel->getAmercementPayInfo($where, "id,status,trade_no");
return $payInfo; return $payInfo;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment