Merge remote-tracking branch 'origin/master'

This commit is contained in:
2025-08-18 11:10:23 +08:00
3 changed files with 40 additions and 34 deletions

View File

@@ -5,10 +5,8 @@ namespace app\api\model;
use app\admin\model\User;
use app\common\library\DatabaseRoute;
use app\common\model\Common;
use ba\Random;
use think\facade\Cache;
use support\Log;
use think\facade\Db;
use think\facade\Log;
use think\Model;
class TaskCenterRecord extends Model

View File

@@ -45,7 +45,7 @@ class CashController extends Frontend
public function withdraw()
{
$amount = $this->request->get('amount');
$isAlipay = $this->request->get('isAlipay/d');
$isAlipay = $this->request->get('isAlipay');
$userId = $this->getUserId();
self::checkCanCash($userId);
$info = (new CommonInfo())->getByCode(930);

View File

@@ -6,12 +6,14 @@ use app\api\model\CommonInfo;
use app\api\model\DiscSpinningRecord;
use app\api\model\Orders;
use app\api\model\TbUser;
use app\api\model\TbUserBlacklist;
use app\common\controller\Frontend;
use app\common\library\DatabaseRoute;
use app\exception\CzgException;
use app\exception\SysException;
use app\queue\redis\DiscReceiveQueue;
use extend\ba\Random;
use think\db\exception\DuplicateException;
use think\facade\Db;
use support\Log;
class DiscSpinningController extends Frontend
@@ -39,6 +41,7 @@ class DiscSpinningController extends Frontend
$resp = [];
runWithLock("user:disc-spinning:limit:user:lock:".$this->getUserId(), 60, function () use ($params, $userId, &$resp, $userInfo) {
DatabaseRoute::transactionXa(function () use ($params, $userId, &$resp, $userInfo) {
try {
// 查询抽奖次数
$count = DiscSpinningRecord::countDraw($userId);
// 免费两次之后校验实名
@@ -75,6 +78,11 @@ class DiscSpinningController extends Frontend
pushQueue(DiscReceiveQueue::class, [
'draws' => $resp
]);
}catch (DuplicateException $e) {
(new TbUserBlacklist())->addBlackUser($userId, "重复抽奖");
throw $e;
}
});
});