1
This commit is contained in:
parent
fe1182921f
commit
f26fc7297a
@ -250,6 +250,17 @@ class BagController extends BaseAuthedController {
|
||||
{
|
||||
$errCode = 0;
|
||||
$errMsg = '';
|
||||
$targetUniId = $param1;
|
||||
$targetDb = Bag::findByUniId($targetUniId);
|
||||
if (!$targetDb) {
|
||||
$this->_rspErr(1, "You don't have the item yet");
|
||||
return;
|
||||
}
|
||||
Bag::decItemByUnIid($itemDb['item_uniid'], $itemNum);
|
||||
$this->propertyChgService->addBagChg();
|
||||
$this->_rspData(array(
|
||||
'property_chg' => $this->propertyChgService->toDto(),
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -24,6 +24,19 @@ class Bag extends BaseModel {
|
||||
return $row;
|
||||
}
|
||||
|
||||
public static function findByUniId($itemUniId)
|
||||
{
|
||||
$row = SqlHelper::ormSelectOne(
|
||||
myself()->_getSelfMysql(),
|
||||
't_bag',
|
||||
array(
|
||||
'account_id' => myself()->_getAccountId(),
|
||||
'idx' => $itemUniId,
|
||||
)
|
||||
);
|
||||
return $row;
|
||||
}
|
||||
|
||||
public static function findByType($type, $subType = null)
|
||||
{
|
||||
foreach (self::all() as $itemDto) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user