修改文件:application\admin\controller\special\SpecialType
修改方法:certificate()
public function certificate($related_id = 0)
{
if (!$related_id) return Json::fail('参数错误');
$certificate = CertificateRelated::where(['related' => $related_id, 'obtain' => 1])->find();
if ($certificate) {
if (Certificate::be(['is_del' => 0, 'status' => 1, 'id' => $certificate['cid']])) {
$id = $certificate['id'];
} else {
$id = 0;
$certificate = [];
}
} else {
$id = 0;
$certificate = [];
}
$this->assign(['related_id' => $related_id, 'id' => $id, 'certificate' => json_encode($certificate)]);
return $this->fetch('special/task/certificate');
}
修改文件:application\merchant\controller\special\SpecialType
修改方法:certificate()
public function certificate($related_id = 0)
{
if (!$related_id) return Json::fail('参数错误');
$certificate = CertificateRelated::where(['related' => $related_id, 'obtain' => 1])->find();
if ($certificate) {
if (Certificate::be(['is_del' => 0, 'status' => 1,'mer_id' => $this->merchantId, 'id' => $certificate['cid']])) {
$id = $certificate['id'];
} else {
$id = 0;
$certificate = [];
}
} else {
$id = 0;
$certificate = [];
}
$this->assign(['related_id' => $related_id, 'id' => $id, 'certificate' => json_encode($certificate)]);
return $this->fetch('special/task/certificate');
}