2023-08-08 12:04:15 +08:00
|
|
|
|
<?php
|
|
|
|
|
// +----------------------------------------------------------------------
|
|
|
|
|
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
|
|
|
|
// +----------------------------------------------------------------------
|
|
|
|
|
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
|
|
|
|
// | 开源版本可自由商用,可去除界面版权logo
|
|
|
|
|
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
|
|
|
|
// | github下载:https://github.com/likeshop-github/likeadmin
|
|
|
|
|
// | 访问官网:https://www.likeadmin.cn
|
|
|
|
|
// | likeadmin团队 版权所有 拥有最终解释权
|
|
|
|
|
// +----------------------------------------------------------------------
|
|
|
|
|
// | author: likeadminTeam
|
|
|
|
|
// +----------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
namespace app\adminapi\lists\task_scheduling;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
use app\adminapi\lists\BaseAdminDataLists;
|
|
|
|
|
use app\common\model\task_scheduling\TaskScheduling;
|
|
|
|
|
use app\common\lists\ListsSearchInterface;
|
2023-08-12 10:38:39 +08:00
|
|
|
|
use app\common\model\auth\Admin;
|
|
|
|
|
use app\common\model\Company;
|
2023-08-08 12:04:15 +08:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 任务公司排期列表
|
|
|
|
|
* Class TaskSchedulingLists
|
|
|
|
|
* @package app\adminapi\liststask_scheduling
|
|
|
|
|
*/
|
|
|
|
|
class TaskSchedulingLists extends BaseAdminDataLists implements ListsSearchInterface
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @notes 设置搜索条件
|
|
|
|
|
* @return \string[][]
|
|
|
|
|
* @author likeadmin
|
|
|
|
|
* @date 2023/08/08 10:08
|
|
|
|
|
*/
|
|
|
|
|
public function setSearch(): array
|
|
|
|
|
{
|
|
|
|
|
return [
|
2023-08-12 10:38:39 +08:00
|
|
|
|
'=' => ['create_user_id', 'template_id', 'company_id', 'company_type', 'status'],
|
2023-08-08 12:04:15 +08:00
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @notes 获取任务公司排期列表
|
|
|
|
|
* @return array
|
|
|
|
|
* @throws \think\db\exception\DataNotFoundException
|
|
|
|
|
* @throws \think\db\exception\DbException
|
|
|
|
|
* @throws \think\db\exception\ModelNotFoundException
|
|
|
|
|
* @author likeadmin
|
|
|
|
|
* @date 2023/08/08 10:08
|
|
|
|
|
*/
|
|
|
|
|
public function lists(): array
|
|
|
|
|
{
|
2023-08-12 10:38:39 +08:00
|
|
|
|
if(isset($params['company_id']) && $params['company_id']!=''){
|
|
|
|
|
$arr= Company::where('company_name','like','%'.$params['company_id'].'%')->column('id');
|
|
|
|
|
if($arr){
|
|
|
|
|
$where[]=['party_a|party_b','in',$arr];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(isset($params['area_manager']) && $params['area_manager']!=''){
|
|
|
|
|
$arr= Admin::where('name','like','%'.$params['area_manager'].'%')->column('id');
|
|
|
|
|
if($arr){
|
|
|
|
|
$where[]=['area_manager','in',$arr];
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-08-08 12:04:15 +08:00
|
|
|
|
return TaskScheduling::where($this->searchWhere)
|
2023-08-12 10:38:39 +08:00
|
|
|
|
->with(['admin','company','company_type_name'])
|
|
|
|
|
->field(['id', 'create_user_id', 'template_id', 'company_id', 'company_type', 'status'])
|
2023-08-08 12:04:15 +08:00
|
|
|
|
->limit($this->limitOffset, $this->limitLength)
|
|
|
|
|
->order(['id' => 'desc'])
|
|
|
|
|
->select()
|
|
|
|
|
->toArray();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @notes 获取任务公司排期数量
|
|
|
|
|
* @return int
|
|
|
|
|
* @author likeadmin
|
|
|
|
|
* @date 2023/08/08 10:08
|
|
|
|
|
*/
|
|
|
|
|
public function count(): int
|
|
|
|
|
{
|
|
|
|
|
return TaskScheduling::where($this->searchWhere)->count();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|