1234567891011121314151617181920212223242526272829303132333435 |
- <?php
- namespace app\data\model;
- use think\admin\Model;
- /**
- * 维修订单需求模型
- * Class DataUserRepair
- * @package app\data\model
- */
- class DataUserRepair extends Model
- {
- /**
- * 格式化创建时间
- * @param string $value
- * @return string
- */
- public function getCreateAtAttr(string $value): string
- {
- return format_datetime($value,'Y-m-d H:i');
- }
- public function getImgsAttr($_,$model){
- return array_filter(explode(',',$model['imgs']));
- }
- public function user(){
- return $this->belongsTo(DataUser::class,'uuid');
- }
- public function success(){
- return $this->belongsTo(DataUser::class,'success_uuid');
- }
- public function offer(){
- return $this->hasMany(DataUserRepairOffer::class,'repair_id');
- }
- }
|