Files
2025-07-27 12:22:34 +08:00

46 lines
1.1 KiB
PHP

<?php
/**
* Created by PhpStorm.
* User: linfan
* Date: 2018/12/06
* Time: 10:23
*/
defined('BASEPATH') or exit('No direct script access allowed');
/*
* 生成订单号
* int $city_id
* string $source 理车【liche】
* string $category
* int $pay_type 微信【1】
* int $order_type 普通订单【1】
* */
if (!function_exists('create_order_no')) {
function create_order_no($city_id = 350200, $source = '')
{
switch ($source) {
case 'liche':
$source_id = sprintf("%02d", 1);
break;
case 'licheb':
$source_id = sprintf("%02d", 2);
break;
case 'pingan':
$source_id = sprintf("%02d", 3);
break;
default:
$source_id = sprintf("%02d", 0);
}
return $city_id . $source_id . date('mdHis') . sprintf("%06d", rand(1, 999999));
}
function create_customer_no($city_id = 900900)
{
return $city_id . date('mdH') . sprintf("%06d", rand(1, 999999));
}
}