OrderProcessService.php 1.3 KB

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace app\admin\service\order;
  3. use app\model\OrderProcess;
  4. use support\Log;
  5. class OrderProcessService
  6. {
  7. public static function insert($params)
  8. {
  9. try {
  10. OrderProcess::insert([
  11. 'join_order_process_member_id' => $params['member_id'],
  12. 'join_order_process_user_id' => $params['user_id'] ?? '',
  13. 'join_order_process_dept_id' => $params['dept_id'] ?? 0,
  14. 'join_process_order_id' => $params['order_id'],
  15. 'order_process_key' => $params['process_key'],
  16. 'order_process_name' => $params['process_name'],
  17. 'order_process_json' => !empty($params['process_json']) ? json_encode($params['process_json']) : '[]',
  18. 'order_process_datetimes' => date('Y-m-d H:i:s'),
  19. 'order_process_remark' => $params['process_remark'] ?? '',
  20. 'order_process_extend_json' => !empty($params['process_extend_json']) ? json_encode($params['process_extend_json']) : '[]',
  21. 'order_process_addtimes' => time()
  22. ]);
  23. } catch (\Exception $e) {
  24. dump($e->getMessage());
  25. $params['msg'] = $e->getMessage();
  26. Log::error("WRITE_ORDER_PROCESS_ERROR", $params);
  27. }
  28. }
  29. }