This commit is contained in:
weiz 2024-05-25 17:30:11 +08:00
parent df8c8976a5
commit 90c9a1fcd8
3 changed files with 17 additions and 1 deletions

View File

@ -107,5 +107,10 @@ class OaFlowTypeController extends BaseAdminController
return $this->data($result);
}
public function all(){
$result = OaFlowTypeLogic::all();
return $this->data($result);
}
}

View File

@ -41,7 +41,7 @@ class OaFlowLists extends BaseAdminDataLists implements ListsSearchInterface
public function setSearch(): array
{
return [
'=' => ['check_type', 'type'],
'=' => ['check_type', 'type','flow_cate'],
'%like%' => ['name'],
];
}

View File

@ -16,6 +16,7 @@ namespace app\adminapi\logic\works\bgsp;
use app\common\model\dept\Dept;
use app\common\model\dict\DictData;
use app\common\model\works\bgsp\OaFlow;
use app\common\model\works\bgsp\OaFlowType;
use app\common\logic\BaseLogic;
@ -137,4 +138,14 @@ class OaFlowTypeLogic extends BaseLogic
$data['data'] = !empty($data['data']) ? json_decode($data['data'],true) : [];
return $data->toArray();
}
public static function all(): array
{
$data = DictData::field('name,value')->where('type_value', 'oa_approve_cate')->select()->each(function($data){
$data['children'] = OaFlowType::field('id,title,data')->where('type',$data['value'])->select()->each(function($item){
$item['data'] = !empty($item['data']) ? json_decode($item['data'],true) : [];
})->toArray();
})->toArray();
return $data;
}
}