ServiceWorkerAllocateWorkerLogic.php 866 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace app\workerapi\logic;
  3. use app\common\logic\BaseLogic;
  4. use app\common\model\works\ServiceWorkAllocateWorkerLog;
  5. /**
  6. * @author 林海涛
  7. * @date 2024/7/16 下午4:03
  8. */
  9. class ServiceWorkerAllocateWorkerLogic extends BaseLogic
  10. {
  11. /**
  12. * @notes 添加
  13. * @param array $params
  14. * @return bool
  15. * @throws
  16. * @author whitef
  17. * @date 2024/07/10 15:06
  18. */
  19. public static function add(array $params): bool
  20. {
  21. if(empty($params['work_id']) || empty($params['master_worker_id']) || empty($params['opera_log'])) {
  22. throw new \Exception('参数错误');
  23. }
  24. ServiceWorkAllocateWorkerLog::create([
  25. 'work_id' => $params['work_id'],
  26. 'master_worker_id' => $params['master_worker_id'],
  27. 'opera_log'=>$params['opera_log']
  28. ]);
  29. return true;
  30. }
  31. }