12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- <?php
- namespace App\Models;
- use App\Traits\ModelHelpers;
- use Illuminate\Database\Eloquent\Model;
- class DepositOrder extends Model
- {
- use ModelHelpers;
- //押金订单表
- protected $table = "deposit_orders";
- protected $guarded = [];
- const STATUS_OK = 1;
- const STATUS_PAUSE = 0;
- public static $statusMaps = [
- self::STATUS_OK => '正常',
- self::STATUS_PAUSE => '暂停'
- ];
- const PAY_STATUS_OK = 1;
- const PAY_STATUS_NO = 0;
- public static $payStatusMaps = [
- self::PAY_STATUS_NO => '未支付',
- self::PAY_STATUS_OK => '缴纳成功'
- ];
- const PAY_TYPE_WECHAT = 0;
- public static $payTypeMaps = [
- self::PAY_TYPE_WECHAT => '微信支付'
- ];
- const REFUND_OK = 1;
- const REFUND_NO = 0;
- public static $refundMaps = [
- self::REFUND_OK => '已退款',
- self::REFUND_NO => '未退款'
- ];
- // 交易类型 用is_refund 判断
- public static $transactionTypeMaps = [
- self::REFUND_OK => '退还押金',
- self::REFUND_NO => '缴纳押金'
- ];
- public function depositRefund(){
- return $this->hasOne(DepositRefund::class,'deposit_id','id');
- }
- public function users(){
- return $this->belongsTo('App\Models\User','user_id','id');
- }
- public function area(){
- return $this->belongsTo(Area::class,'area_id','id');
- }
- }
|