兼容修改
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user