1
This commit is contained in:
parent
a7f9f5cedf
commit
9c9fa008c5
@ -2,8 +2,6 @@
|
||||
|
||||
namespace models;
|
||||
|
||||
require_once('mt/Item.php');
|
||||
|
||||
use mt;
|
||||
use phpcommon\SqlHelper;
|
||||
|
||||
@ -21,7 +19,7 @@ class LuckySymbol extends BaseModel {
|
||||
return empty($row) ? false : $row['in_use_item'] > 0;
|
||||
}
|
||||
|
||||
public static function decLuckySymbol()
|
||||
public static function dec()
|
||||
{
|
||||
SqlHelper::update
|
||||
(myself()->_getSelfMysql(),
|
||||
@ -36,7 +34,7 @@ class LuckySymbol extends BaseModel {
|
||||
);
|
||||
}
|
||||
|
||||
public static function addLuckySymbol()
|
||||
public static function add()
|
||||
{
|
||||
SqlHelper::upsert
|
||||
(myself()->_getSelfMysql(),
|
||||
|
@ -2,32 +2,41 @@
|
||||
|
||||
namespace models;
|
||||
|
||||
require_once('mt/Item.php');
|
||||
|
||||
use mt;
|
||||
use phpcommon\SqlHelper;
|
||||
|
||||
class LuckySymbolRecord extends BaseModel {
|
||||
|
||||
public static function find($itemId)
|
||||
public static function find($roomUuid)
|
||||
{
|
||||
$row = SqlHelper::ormSelectOne(
|
||||
myself()->_getSelfMysql(),
|
||||
't_bag',
|
||||
't_lucky_symbol_record',
|
||||
array(
|
||||
'account_id' => myself()->_getAccountId(),
|
||||
'item_id' => $itemId,
|
||||
'room_uuid' => $roomUuid,
|
||||
)
|
||||
);
|
||||
if ($row) {
|
||||
$row['item_uniid'] = $row['idx'];
|
||||
if ($row['account_id'] != myself()->_getAccountId()) {
|
||||
if (!NftService::isEquipOwner(myself()->_getAddress(), $row['token_id'])) {
|
||||
$row = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $row;
|
||||
}
|
||||
|
||||
public static function add($roomUuid)
|
||||
{
|
||||
SqlHelper::upsert
|
||||
(myself()->_getSelfMysql(),
|
||||
't_lucky_symbol_record',
|
||||
array(
|
||||
'account_id' => myself()->_getAccountId(),
|
||||
),
|
||||
array(
|
||||
),
|
||||
array(
|
||||
'account_id' => myself()->_getAccountId(),
|
||||
'room_uuid' => $roomUuid,
|
||||
'createtime' => myself()->_getNowTime(),
|
||||
'modifytime' => myself()->_getNowTime(),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user