63 lines
1.2 KiB
PHP
63 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace models;
|
|
|
|
use phpcommon\SqlHelper;
|
|
|
|
class Market extends BaseModel {
|
|
|
|
const PENDING_STATE = 0;
|
|
const BUY_OK_STATUS = 1;
|
|
const CANCEL_STATUS = 2;
|
|
|
|
public static function find($orderId){
|
|
$row = SqlHelper::ormSelectOne(
|
|
myself()->_getMysql(''),
|
|
't_market',
|
|
array(
|
|
'order_id' => $orderId
|
|
)
|
|
);
|
|
return $row;
|
|
}
|
|
|
|
public static function add($orderId, $fieldsKv) {
|
|
}
|
|
|
|
public static function updatePrice($orderId, $currency, $price) {
|
|
|
|
}
|
|
|
|
public static function buyOk($orderId) {
|
|
|
|
}
|
|
|
|
public static function cancel($orderId) {
|
|
|
|
}
|
|
|
|
private static function internalUpdate($orderId, $fieldsKv){
|
|
SqlHelper::upsert
|
|
(myself()->_getMysql(''),
|
|
't_market',
|
|
array(
|
|
'order_id' => $orderId
|
|
),
|
|
array(
|
|
),
|
|
array(
|
|
'order_id' => $orderId,
|
|
)
|
|
);
|
|
SqlHelper::update
|
|
(myself()->_getMysql(''),
|
|
't_market',
|
|
array(
|
|
'order_id' => $orderId
|
|
),
|
|
$fieldsKv
|
|
);
|
|
}
|
|
|
|
}
|