<?php
namespace app\workerapi\logic;
use app\common\logic\BaseLogic;
use app\common\model\works\ServiceWorkLog;
use think\Exception;
use think\facade\Db;


/**
 * ServiceWorkLog逻辑
 * Class ServiceWorkLogLogic
 * @package app\workerapi\logic\works
 */
class ServiceWorkLogLogic extends BaseLogic
{
    /**
     * @notes 添加
     * @param array $params
     * @return bool
     * @throws Exception
     * @author whitef
     * @date 2024/07/10 15:06
     */
    public static function add(array $params): bool
    {
        if(empty($params['work_id']) || empty($params['master_worker_id']) || empty($params['opera_log'])) {
            throw new Exception('参数错误');
        }
        ServiceWorkLog::create([
            'work_id' => $params['work_id'],
            'master_worker_id' => $params['master_worker_id'],
            'opera_log'=>$params['opera_log']
        ]);

        return true;
    }
}