Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -5,10 +5,8 @@ namespace app\api\model;
|
|||||||
use app\admin\model\User;
|
use app\admin\model\User;
|
||||||
use app\common\library\DatabaseRoute;
|
use app\common\library\DatabaseRoute;
|
||||||
use app\common\model\Common;
|
use app\common\model\Common;
|
||||||
use ba\Random;
|
use support\Log;
|
||||||
use think\facade\Cache;
|
|
||||||
use think\facade\Db;
|
use think\facade\Db;
|
||||||
use think\facade\Log;
|
|
||||||
use think\Model;
|
use think\Model;
|
||||||
|
|
||||||
class TaskCenterRecord extends Model
|
class TaskCenterRecord extends Model
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ class CashController extends Frontend
|
|||||||
public function withdraw()
|
public function withdraw()
|
||||||
{
|
{
|
||||||
$amount = $this->request->get('amount');
|
$amount = $this->request->get('amount');
|
||||||
$isAlipay = $this->request->get('isAlipay/d');
|
$isAlipay = $this->request->get('isAlipay');
|
||||||
$userId = $this->getUserId();
|
$userId = $this->getUserId();
|
||||||
self::checkCanCash($userId);
|
self::checkCanCash($userId);
|
||||||
$info = (new CommonInfo())->getByCode(930);
|
$info = (new CommonInfo())->getByCode(930);
|
||||||
|
|||||||
@@ -6,12 +6,14 @@ use app\api\model\CommonInfo;
|
|||||||
use app\api\model\DiscSpinningRecord;
|
use app\api\model\DiscSpinningRecord;
|
||||||
use app\api\model\Orders;
|
use app\api\model\Orders;
|
||||||
use app\api\model\TbUser;
|
use app\api\model\TbUser;
|
||||||
|
use app\api\model\TbUserBlacklist;
|
||||||
use app\common\controller\Frontend;
|
use app\common\controller\Frontend;
|
||||||
use app\common\library\DatabaseRoute;
|
use app\common\library\DatabaseRoute;
|
||||||
use app\exception\CzgException;
|
use app\exception\CzgException;
|
||||||
use app\exception\SysException;
|
use app\exception\SysException;
|
||||||
use app\queue\redis\DiscReceiveQueue;
|
use app\queue\redis\DiscReceiveQueue;
|
||||||
use extend\ba\Random;
|
use extend\ba\Random;
|
||||||
|
use think\db\exception\DuplicateException;
|
||||||
use think\facade\Db;
|
use think\facade\Db;
|
||||||
use support\Log;
|
use support\Log;
|
||||||
class DiscSpinningController extends Frontend
|
class DiscSpinningController extends Frontend
|
||||||
@@ -39,6 +41,7 @@ class DiscSpinningController extends Frontend
|
|||||||
$resp = [];
|
$resp = [];
|
||||||
runWithLock("user:disc-spinning:limit:user:lock:".$this->getUserId(), 60, function () use ($params, $userId, &$resp, $userInfo) {
|
runWithLock("user:disc-spinning:limit:user:lock:".$this->getUserId(), 60, function () use ($params, $userId, &$resp, $userInfo) {
|
||||||
DatabaseRoute::transactionXa(function () use ($params, $userId, &$resp, $userInfo) {
|
DatabaseRoute::transactionXa(function () use ($params, $userId, &$resp, $userInfo) {
|
||||||
|
try {
|
||||||
// 查询抽奖次数
|
// 查询抽奖次数
|
||||||
$count = DiscSpinningRecord::countDraw($userId);
|
$count = DiscSpinningRecord::countDraw($userId);
|
||||||
// 免费两次之后校验实名
|
// 免费两次之后校验实名
|
||||||
@@ -75,6 +78,11 @@ class DiscSpinningController extends Frontend
|
|||||||
pushQueue(DiscReceiveQueue::class, [
|
pushQueue(DiscReceiveQueue::class, [
|
||||||
'draws' => $resp
|
'draws' => $resp
|
||||||
]);
|
]);
|
||||||
|
}catch (DuplicateException $e) {
|
||||||
|
(new TbUserBlacklist())->addBlackUser($userId, "重复抽奖");
|
||||||
|
throw $e;
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user