【程序目录】新增检测小程序是否存在方法

This commit is contained in:
evoxwht 2022-05-25 09:05:12 +08:00
parent d3c3b379d1
commit a8cc4a734f
2 changed files with 15 additions and 3 deletions

View File

@ -360,9 +360,9 @@ class UserBillController
$systemAttachment->delete(['name' => $name]);
}
$siteUrl = sys_config('site_url');
if (!$imageInfo) {
/** @var QrcodeServices $qrCode */
$qrCode = app()->make(QrcodeServices::class);
/** @var QrcodeServices $qrCode */
$qrCode = app()->make(QrcodeServices::class);
if (!$imageInfo && !$qrCode->qrCOdeExist($user['uid'], 'spread')) {
$resForever = $qrCode->qrCodeForever($user['uid'], 'spread', '', '');
$resCode = MiniProgramService::qrcodeService()->appCodeUnlimit($resForever->id, '', 280);
if ($resCode) {

View File

@ -340,4 +340,16 @@ class QrcodeServices extends BaseServices
}
return $re;
}
/**
* 检测是否存在
* @param int $thirdId
* @param string $thirdType
* @return bool
*/
public function qrCodeExist($thirdId = 0, $thirdType = 'spread')
{
return !!$this->dao->getCount(['third_id' => $thirdId, 'third_type' => $thirdType]);
}
}