Merge pull request 'update' (#11) from zhangwei into dev
Reviewed-on: #11
This commit is contained in:
commit
92c15e4723
@ -107,6 +107,7 @@ class DeptLogic extends BaseLogic
|
|||||||
}
|
}
|
||||||
$org = Orgs::where('id',$dept['org_id'])->findOrEmpty();
|
$org = Orgs::where('id',$dept['org_id'])->findOrEmpty();
|
||||||
$dept['org_name'] = $org->isEmpty() ? '' : $org['name'];
|
$dept['org_name'] = $org->isEmpty() ? '' : $org['name'];
|
||||||
|
$dept['status_text'] = $dept->status_text;
|
||||||
return $dept->toArray();
|
return $dept->toArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,6 +100,7 @@ class JobsLogic extends BaseLogic
|
|||||||
}
|
}
|
||||||
$dept = Dept::where('id',$jobs['dept_id'])->findOrEmpty();
|
$dept = Dept::where('id',$jobs['dept_id'])->findOrEmpty();
|
||||||
$jobs['dept_name'] = $dept->isEmpty() ? '' : $dept['name'];
|
$jobs['dept_name'] = $dept->isEmpty() ? '' : $dept['name'];
|
||||||
|
$jobs['status_text'] = $jobs->status_text;
|
||||||
return $jobs->toArray();
|
return $jobs->toArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,6 +112,8 @@ class OrgsLogic extends BaseLogic
|
|||||||
*/
|
*/
|
||||||
public static function detail($params): array
|
public static function detail($params): array
|
||||||
{
|
{
|
||||||
return Orgs::field('id,name,master,status,create_time')->findOrEmpty($params['id'])->toArray();
|
$res = Orgs::field('id,name,master,status,create_time')->findOrEmpty($params['id']);
|
||||||
|
$res['status_text'] = $res->status_text;
|
||||||
|
return $res->toArray();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -30,10 +30,10 @@ class Dept extends BaseModel
|
|||||||
|
|
||||||
protected $deleteTime = 'delete_time';
|
protected $deleteTime = 'delete_time';
|
||||||
|
|
||||||
public function getStatusAttr($value): string
|
public function getStatusTextAttr($value,$data): string
|
||||||
{
|
{
|
||||||
$status = [1=>'禁用',0=>'正常'];
|
$status = [0=>'正常',1=>'停用'];
|
||||||
return $status[$value];
|
return $status[$data['status']];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -29,9 +29,9 @@ class Jobs extends BaseModel
|
|||||||
|
|
||||||
protected $deleteTime = 'delete_time';
|
protected $deleteTime = 'delete_time';
|
||||||
|
|
||||||
public function getStatusAttr($value): string
|
public function getStatusTextAttr($value,$data): string
|
||||||
{
|
{
|
||||||
$status = [1=>'禁用',0=>'正常'];
|
$status = [0=>'正常',1=>'停用'];
|
||||||
return $status[$value];
|
return $status[$data['status']];
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -30,10 +30,10 @@ class Orgs extends BaseModel
|
|||||||
protected $name = 'orgs';
|
protected $name = 'orgs';
|
||||||
protected $deleteTime = 'delete_time';
|
protected $deleteTime = 'delete_time';
|
||||||
|
|
||||||
public function getStatusAttr($value): string
|
public function getStatusTextAttr($value,$data): string
|
||||||
{
|
{
|
||||||
$status = [1=>'禁用',0=>'正常'];
|
$status = [0=>'正常',1=>'停用'];
|
||||||
return $status[$value];
|
return $status[$data['status']];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user