This commit is contained in:
hujiabin 2023-09-26 18:57:39 +08:00
parent 4d054b561b
commit 7ad3a54f6c
2 changed files with 2 additions and 1 deletions

View File

@ -171,6 +171,7 @@ class ComputingPowerController extends BaseAuthedController
break;
case ComputingPower::CRYSTAL4 : {
$recordDb = CrystalRecord::getNewestRecordOne($itemId);
error_log('exchangeCrystal:'.json_encode($recordDb));
if ($recordDb && myself()->_getNowDaySeconds() == myself()->_getDaySeconds($recordDb['createtime'])){
$this->_rspErr(1, 'There are no available crystals');
return ;

View File

@ -55,7 +55,7 @@ class CrystalRecord extends BaseModel
}
public static function getNewestRecordOne($itemId){
$sql = "select * from t_crystal_exchange_record where `account_id` = :account_id and item_id = :item_id order by createtime desc limit 1";
$sql = "select * from t_crystal_exchange_record where `account_id` = :account_id and item_id = :item_id order by idx desc limit 1";
$rows = myself()->_getMysql('')->execQuery($sql,array(
'account_id' =>myself()->_getAccountId(),
'item_id' =>$itemId,