24 lines
637 B
PHP
24 lines
637 B
PHP
|
<?php
|
|||
|
|
|||
|
namespace app\common\model\dict;
|
|||
|
|
|||
|
use app\common\model\BaseModel;
|
|||
|
|
|||
|
class WorkerDictData extends BaseModel
|
|||
|
{
|
|||
|
protected $connection = 'mysql2';
|
|||
|
protected $name = 'la_dict_data';
|
|||
|
public function getStatusDescAttr($value, $data): string
|
|||
|
{
|
|||
|
return $data['status'] ? '正常' : '停用';
|
|||
|
}
|
|||
|
|
|||
|
// 根据镇农科公司任务类型,获取code
|
|||
|
public function getTownTaskType($typeId){
|
|||
|
$townTaskTypeList = WorkerDictData::where(['type_value' => 'town_task_type', 'status' => 1])->column('value', 'id');
|
|||
|
if(isset($townTaskTypeList[$typeId])) {
|
|||
|
return $townTaskTypeList[$typeId];
|
|||
|
}
|
|||
|
return '';
|
|||
|
}
|
|||
|
}
|