截流自动化的商城平台
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

OrderLog.php 953B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace app\common\model\order;
  3. use app\common\basics\Models;
  4. use app\common\enum\OrderLogEnum;
  5. use think\facade\Db;
  6. /**
  7. * Class OrderLog
  8. * @package app\common\model\order
  9. */
  10. class OrderLog extends Models
  11. {
  12. /**
  13. * @notes 订单日志
  14. * @param $order_id
  15. * @return array|array[]|\array[][]|\array[][][]
  16. * @throws \think\db\exception\DataNotFoundException
  17. * @throws \think\db\exception\ModelNotFoundException
  18. * @throws \think\exception\DbException
  19. * @author suny
  20. * @date 2021/7/13 6:45 下午
  21. */
  22. public static function getOrderLog($order_id)
  23. {
  24. $logs = Db::name('order_log')
  25. ->where('order_id', $order_id)
  26. ->select()->toArray();
  27. foreach ($logs as &$log) {
  28. $log['create_time'] = date('Y-m-d H:i:s', $log['create_time']);
  29. $log['channel'] = OrderLogEnum::getLogDesc($log['channel']);
  30. }
  31. return $logs;
  32. }
  33. }