@@ -3,6 +3,7 @@
namespace app\data\model;
use app\data\model\helpers\PurchaseShow;
+use Carbon\Carbon;
use think\admin\Model;
use think\db\Query;
use think\facade\Db;
@@ -107,6 +108,6 @@ class ShopPurchase extends Model
}
public static function onBeforeInsert(self $model)
{
- $model['order_no']=sprintf('%s%s','Cbz',str_replace('.','',microtime(1)));
+ $model['order_no']=sprintf('%s%s','Cbz',str_replace(['-',' ','.',':'],'',Carbon::now()->toDateTimeString('microsecond')));
@@ -16,6 +16,7 @@
namespace app\index\controller;
use think\admin\Controller;
/**