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.
32 lines
818 B
32 lines
818 B
<?php
|
|
|
|
namespace app\fire\model;
|
|
|
|
use think\model\concern\SoftDelete;
|
|
|
|
class FireProduct extends Base
|
|
{
|
|
use SoftDelete;
|
|
protected $type = [
|
|
'img_path' => 'serialize',
|
|
'detail_img' => 'serialize',
|
|
'report_img' => 'serialize',
|
|
'price_img' => 'serialize',
|
|
];
|
|
|
|
public function productSupply()
|
|
{
|
|
return $this->hasOne('FireSupply','id','supply_id')->bind(['company_name','user_id','mobile_phone']);
|
|
}
|
|
|
|
public function getStatusTextAttr($value,$data)
|
|
{
|
|
$status = [1=>'暂存',2=>'待审核',3=>'未上架',4=>'展示中',5=>'审核拒绝'];
|
|
return $status[$data['status']];
|
|
}
|
|
|
|
public function productCategory()
|
|
{
|
|
return $this->hasOne('FireProductCategory','id','category_id')->bind(['category_name'=>'name']);
|
|
}
|
|
} |