<?php


namespace app\shared\model;

use think\Model as ThinkModel;

class HouseOrderContinue extends ThinkModel
{
    // 设置当前模型对应的完整数据表名称
    protected $name = 'shared_house_order_continue';

    // 自动写入时间戳
    protected $autoWriteTimestamp = true;

   	static public function crateOrderNo($type="XD"){
   		$order_no=$type.date('YmdHis').rand(1000,9999);
   		while (self::where('order_no',$order_no)->count()) {
   			self::crateOrderNo($type);
   		}
   		return $order_no;
   	}
    //退款订单号
    static public function crateOutOrderNo($type="T"){
      $order_no=$type.date('YmdHis').rand(1000,9999);
      while (self::where('out_order_no',$order_no)->count()) {
        self::crateOutOrderNo($type);
      }
      return $order_no;
    }
}