_getMysql(''), 't_ingame_mall', array( 'order_id' => $orderId ) ); return $row; } public static function add($orderId, $orderType, $goodsUniid,$itemId, $itemNum, $payType,$price, $orderField) { SqlHelper::insert (myself()->_getMysql(''), 't_ingame_mall', array( 'order_id' => $orderId, 'order_type' => $orderType, 'seller' => myself()->_getAccountId(), 'seller_address' => myself()->_getAddress(), 'goods_uniid' => $goodsUniid, 'item_id' => $itemId, 'item_num' => $itemNum, 'pay_type' => $payType, 'price' => $price, 'order1' => $orderField, 'unit_price' => $price/$itemNum, 'last_modify_price_time' => myself()->_getNowTime(), 'createtime' => myself()->_getNowTime(), 'modifytime' => myself()->_getNowTime(), )); } public static function modifyPrice($orderId, $price,$unitPrice) { SqlHelper::update (myself()->_getMysql(''), 't_ingame_mall', array( 'order_id' => $orderId ), array( 'price' => $price, 'unit_price' => $unitPrice, 'last_modify_price_time' => myself()->_getNowTime(), ) ); } public static function cancel($orderId) { SqlHelper::update (myself()->_getMysql(''), 't_ingame_mall', array( 'order_id' => $orderId ), array( 'status' => self::CANCEL_STATE, 'modifytime' => myself()->_getNowTime(), ) ); } public static function buyOk($orderId, $buyer) { SqlHelper::update (myself()->_getMysql(''), 't_ingame_mall', array( 'order_id' => $orderId ), array( 'status' => self::BUY_OK_STATE, 'buyer' => $buyer, 'buy_ok_time' => myself()->_getNowTime() ) ); } public static function getMySell($cb){ SqlHelper::ormSelect( myself()->_getMysql(''), 't_ingame_mall', array( 'seller' => myself()->_getAccountId() ), function ($row) use($cb) { $cb($row); } ); } public static function getMyBuy($cb){ SqlHelper::ormSelect( myself()->_getMysql(''), 't_ingame_mall', array( 'buyer' => myself()->_getAccountId() ), function ($row) use($cb) { $cb($row); } ); } }