data_center/app/common/model/dict/WorkerDictData.php

24 lines
637 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?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 '';
}
}