This commit is contained in:
mkm 2023-08-16 14:56:25 +08:00
parent 9344ccd4a8
commit a1f6172672
4 changed files with 22 additions and 4 deletions

View File

@ -18,7 +18,7 @@ namespace app\adminapi\lists\task_template;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\task_template\TaskTemplate;
use app\common\lists\ListsSearchInterface;
use app\common\model\task_scheduling\TaskScheduling;
/**
* 任务模板列表
@ -54,7 +54,14 @@ class TaskTemplateLists extends BaseAdminDataLists implements ListsSearchInterfa
*/
public function lists(): array
{
$parmas= $this->request->param();
$where=[];
if(isset($parmas['scheduling_id']) && $parmas['scheduling_id']>0){
$company_id=TaskScheduling::where(['id'=>$parmas['scheduling_id']])->value('company_id');
$where[]= ['company_id','=',$company_id];
}
return TaskTemplate::where($this->searchWhere)
->where($where)
->with(['admin','data_type'])
->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc'])

View File

@ -16,7 +16,7 @@ class CeshiController extends BaseApiController
public function index()
{
$all=TaskSchedulingPlan::whereDay('start_time')->where('is_pay',0)->with(['template_info','scheduling'])->select()->toArray();
// halt($all);
halt($all);
foreach($all as $k=>$v){
queue(TaskInformationJob::class,$v);
}

View File

@ -3,6 +3,7 @@
namespace app\api\controller;
use app\common\model\task\Task;
use app\common\model\user\User;
class TaskController extends BaseApiController{
@ -12,7 +13,12 @@ class TaskController extends BaseApiController{
if($this->userInfo['admin_id']!=0){
$where[]=['company_id','=',$this->userInfo['company_id']];
}else{
$where[]=['director_uid','=',$this->userId];
$is_captain=User::where('id',$this->userId)->value('is_captain');
if($is_captain==1){
$where[]=['type','=',31];
}else{
$where[]=['director_uid','=',$this->userId];
}
// $where[]=['status','in',[1,2,3,5]];
}
if(isset($param['date_time']) && $param['date_time']!=''){

View File

@ -84,15 +84,20 @@ class TaskLogic extends BaseLogic
'content' => $v['template_info']['content'],
'start_time' => strtotime($v['start_time']),
'end_time' => strtotime($v['end_time']),
"extend" => json_encode([]),
'create_time' => time(),
'update_time' => time(),
];
$data = $arr;
$data['money'] = self::task_money($v);
if($v['template_info']['type'] == 31){
$data["extend"]=json_encode(['informationg'=>['count'=>5,'update'=>0]]);
}else{
$data["extend"]=json_encode([]);
}
if ($v['template_info']['type'] == 32) {
$data['director_uid'] = $v['company']['user_id'];
}
$task_id = (new Task())->insertGetId($data);
TaskSchedulingPlan::where('id', $v['id'])->update(['task_id' => $task_id, 'is_execute' => 1]);
return true;