|
|
@@ -61,11 +61,21 @@ class DeviceRepair extends Model
|
|
|
* @param int $uid
|
|
|
* @return bool|string
|
|
|
*/
|
|
|
- public static function getNewOrderId($uid = 0)
|
|
|
+// public static function getNewOrderId($uid = 0)
|
|
|
+// {
|
|
|
+// if (!$uid) return false;
|
|
|
+// $count = (int)self::where('uid', $uid)->where('add_time', '>=', strtotime(date("Y-m-d")))->where('add_time', '<', strtotime(date("Y-m-d", strtotime('+1 day'))))->count();
|
|
|
+// return 'bx' . date('YmdHis', time()) . (10000 + $count + $uid);
|
|
|
+// }
|
|
|
+
|
|
|
+ public static function getNewOrderId()
|
|
|
{
|
|
|
- if (!$uid) return false;
|
|
|
- $count = (int)self::where('uid', $uid)->where('add_time', '>=', strtotime(date("Y-m-d")))->where('add_time', '<', strtotime(date("Y-m-d", strtotime('+1 day'))))->count();
|
|
|
- return 'bx' . date('YmdHis', time()) . (10000 + $count + $uid);
|
|
|
+ do {
|
|
|
+ list($msec, $sec) = explode(' ', microtime());
|
|
|
+ $msectime = number_format((floatval($msec) + floatval($sec)) * 1000, 0, '', '');
|
|
|
+ $orderId = 'bx' . $msectime . mt_rand(10000, 99999);
|
|
|
+ } while (self::be(['order_id' => $orderId]));// $orderId = 'wx' . $msectime . mt_rand(10000, 99999);
|
|
|
+ return $orderId;
|
|
|
}
|
|
|
/**
|
|
|
* 后台获取报修列表(带分页、状态筛选)
|