main
fengxinyhyl 4 months ago
parent ea524c1ee7
commit a5180d9fb4
  1. 8
      app/controller/api/user/User.php

@ -63,12 +63,12 @@ class User extends BaseController
$where = array(); $where = array();
$where[] = array('uid', '=', $uid); $where[] = array('uid', '=', $uid);
$where[] = array('create_time', '>=', date('Y-m-d 00:00:00')); $where[] = array('create_time', '>=', date('Y-m-d')." 00:00:00");
$where[] = array('type', 'in', [1, 2]); $where[] = array('type', 'in', [1, 2]);
$list = $recordRepository->selectWhere($where); $logList = $recordRepository->selectWhere($where);
$config = $assetsRepository->getConfig(); $config = $assetsRepository->getConfig();
if($list && count($list) >= 1){ if($logList && count($logList) >= 1){
$assets = $assetsRepository->assets($uid); $assets = $assetsRepository->assets($uid);
if($assets['diamond'] < $config['lotteryPayDiamond']){ if($assets['diamond'] < $config['lotteryPayDiamond']){
return app('json')->fail('钻石不足'); return app('json')->fail('钻石不足');
@ -86,7 +86,7 @@ class User extends BaseController
} }
} }
if($list && count($list) >= 1 && $current['type'] != 3){ if($logList && count($logList) >= 1 && $current['type'] != 3){
$assetsRepository->lottery($uid, -$config['lotteryPayDiamond']); $assetsRepository->lottery($uid, -$config['lotteryPayDiamond']);
} }

Loading…
Cancel
Save