TaskFollowLogic.php 844 字节
<?php

namespace App\Http\Logic\Aside\Task;


use App\Helper\Arr;
use App\Http\Logic\Aside\BaseLogic;
use App\Http\Logic\Aside\LoginLogic;
use App\Models\Task\TaskFollow;

/**
 * Class TaskFollowLogic
 * @package App\Http\Logic\Aside\Task
 * @author zbj
 * @date 2023/4/27
 */
class TaskFollowLogic extends BaseLogic
{
    public function __construct()
    {
        parent::__construct();

        $this->model = new TaskFollow();
    }

    public function save($param){
        $task = $this::getInfo($param['task_id']);
        if(!$task){
            $this->fail('任务不存在');
        }
        $manage_ids = Arr::pluck($task['owner'], 'manage_id');
        if(!in_array(LoginLogic::manage('id'), $manage_ids)){
            $this->fail('非本人任务,不能添加跟进记录');
        }
        parent::save($param);
    }


}