'已支付', self::PAY_STATUS_OK => '未支付' ]; //企业支付到账类型 public static $refundTypeMaps = [ self::REFUND_TYPE_BALANCE => '支付到余额', ]; /** * 生成订单号 * @return bool|string * User: Mead */ public static function makeNo() { // 订单流水号前缀 $prefix = config('bike.no_tag') . self::NO_TAG . date('YmdHis'); for ($i = 0; $i < 10; $i++) { // 随机生成 6 位的数字 $no = $prefix . str_pad(random_int(0, 999999), 6, '0', STR_PAD_LEFT); // 判断是否已经存在 if (!static::query()->where('no', $no)->exists()) { return $no; } } Log::warning('find order no failed'); return false; } public function users(){ return $this->belongsTo(User::class, 'user_id', 'id'); } public function area() { return $this->belongsTo(Area::class, 'area_id', 'id'); } public function adminUser(){ return $this->belongsTo(AdminUser::class, 'admin_id', 'id'); } }