Commit 9c1c899d authored by wangzhengwen's avatar wangzhengwen

证书

parent e5600d4a
......@@ -109,7 +109,7 @@ class Cert extends BaseController
'cert_id' => $data['cert_id'],
'user_id' => $userId,
'is_del' => 0
])->where('status', '>', 0)->exists() ? 0 : $detail['price'];
])->where('status', '>', 0)->count() ? 0 : $detail['price'];
}
}
......
......@@ -53,8 +53,20 @@ class CertOrder extends BaseController
{
//申请中
$data['status'] = 1;
}else{
//是否付费证书 并且已经报名过的了
$order_count = OrderModel::where([
'cert_id' => $data['cert_id'],
'user_id' => $data['user_id'],
'is_del' => 0
])->where('status', '>', 0)->count();
if ($order_count)
{
$data['status'] = 1;
}
}
$enrollCert = OrderModel::create($data);
return $this->returnMsg('success',1,$enrollCert);
......
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