29 lines
693 B
PHP
29 lines
693 B
PHP
<?php
|
|
|
|
|
|
namespace models;
|
|
|
|
|
|
use phpcommon;
|
|
use phpcommon\SqlHelper;
|
|
|
|
class OrderId {
|
|
|
|
public static function gen(){
|
|
SqlHelper::insert
|
|
(myself()->_getSelfMysql(),
|
|
't_orderid',
|
|
array(
|
|
'account_id' => myself()->_getAccountId(),
|
|
'request' => json_encode($_REQUEST),
|
|
'createtime' => myself()->_getNowTime(),
|
|
'modifytime' => myself()->_getNowTime(),
|
|
)
|
|
);
|
|
$lastIdx = SqlHelper::getLastInsertId(myself()->_getSelfMysql());
|
|
$orderId = strftime('%Y%m%d%H%M%S', myself()->_getNowTime()) . phpcommon\pad($lastIdx % 100000, 5);
|
|
return $orderId;
|
|
}
|
|
|
|
}
|