MasterWorkerCustomerLogic.php 720 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace app\workerapi\logic;
  3. use app\common\logic\BaseLogic;
  4. use app\common\model\master_worker_customer\MasterWorkerCustomer;
  5. /**
  6. * @author 林海涛
  7. * @date 2024/7/10 下午5:46
  8. */
  9. class MasterWorkerCustomerLogic extends BaseLogic
  10. {
  11. public static function submitCustomerProblem($params, $userId)
  12. {
  13. try {
  14. MasterWorkerCustomer::create([
  15. 'worker_id' => $userId,
  16. 'name' => $params['name'],
  17. 'mobile' => $params['mobile'],
  18. 'problem' => $params['problem'],
  19. ]);
  20. return true;
  21. } catch (\Exception $e) {
  22. self::setError($e->getMessage());
  23. return false;
  24. }
  25. }
  26. }