You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
bjhedasx/app/fire/model/FireExpertOrder.php

43 lines
1.1 KiB

<?php
namespace app\fire\model;
use app\base\model\user\User;
use app\base\model\user\UserInfo;
use think\model\concern\SoftDelete;
class FireExpertOrder extends Base
{
use SoftDelete;
public function orderUser()
{
return $this->hasOne(UserInfo::class,'user_id','user_id')->bind(['nick_name','head_img']);
}
public function orderAsk()
{
return $this->hasOne('FireExpertOrderAsk','order_id','id')->bind(['ask_content']);
}
public function getStatusTextAttr($value,$data)
{
$status = [1=>'待支付',2=>'进行中',3=>'待评价',4=>'已完成',5=>'已退款',6=>'已取消'];
return $status[$data['status']];
}
public function orderReplyReview()
{
return $this->hasOne('FireExpertOrderReview','order_id','id')->bind(['is_reply']);
}
public function orderUserData()
{
return $this->hasOne(User::class,'id','user_id')->bind(['mobile_phone']);
}
public function orderAnswer()
{
return $this->hasMany('FireExpertOrderAsk','order_id','id')->where(['type'=>2]);
}
}