In.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <?php
  2. namespace Scm_servicer\Lib;
  3. use Dever;
  4. class In
  5. {
  6. # 获取订单信息
  7. public function info($id)
  8. {
  9. Dever::load('manage/auth.init');
  10. $info = Dever::db('scm_servicer/in_order')->find($id);
  11. $string = '';
  12. $string = $info['order_num'];
  13. $servicer = Dever::db('scm_servicer/info')->one($info['servicer_id']);
  14. $string .= '<br />' . $servicer['name'];
  15. $store = Dever::db('scm_servicer/store')->one($info['servicer_store_id']);
  16. $string .= '.' . $store['name'];
  17. $string .= '<br />' . $info['info'];
  18. return $string;
  19. }
  20. # 查看详情
  21. public function show_api()
  22. {
  23. $id = Dever::input('id');
  24. $config = Dever::db('scm_servicer/in_order')->config['set'];
  25. $info = Dever::db('scm_servicer/in_order')->one($id);
  26. $status = Dever::status($config['status'], $info['status']);
  27. $member = Dever::db('scm_servicer/info')->one($info['servicer_id']);
  28. $store = Dever::db('scm_servicer/store')->one($info['servicer_store_id']);
  29. $supplier = Dever::db('scm_supplier/info')->one($info['supplier_id']);
  30. $cdate = date('Y-m-d H:i', $info['cdate']);
  31. $result = array();
  32. $result[$info['order_num']] = array
  33. (
  34. 'type' => 'info',
  35. 'content' => array
  36. (
  37. array
  38. (
  39. array('配送商', $member['name']),
  40. array('仓库', $store['name']),
  41. array('供应商', $supplier['name']),
  42. ),
  43. array
  44. (
  45. array('订单状态', $status),
  46. array('订单备注', $info['info']),
  47. ),
  48. ),
  49. );
  50. $table = array();
  51. $table['head'] = array('名称', '单价', '数量', '状态');
  52. $table['body'] = array();
  53. $data = Dever::db('scm_servicer/in_order_goods')->select(array('order_id' => $id));
  54. if ($data) {
  55. $status = Dever::db('scm_servicer/in_order_goods')->config['status'];
  56. foreach ($data as $k => $v) {
  57. $goods_info = Dever::load('scm_product/lib/info')->getBaseInfo($v['goods_id'], $v['sku_id']);
  58. $status_name = Dever::status($status, $v['status']);
  59. $table['body'][$k][] = $goods_info['name'];
  60. $table['body'][$k][] = $v['cash'];
  61. $table['body'][$k][] = $v['num'];
  62. $table['body'][$k][] = $status_name;
  63. }
  64. }
  65. $body[''] = array
  66. (
  67. 'type' => 'table',
  68. 'content' => $table,
  69. );
  70. $head = array
  71. (
  72. 'name' => '基本信息',
  73. 'btn' => '',
  74. );
  75. $html = Dever::show($head, $result);
  76. return $html;
  77. }
  78. }