Manage.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <?php
  2. namespace Scm_servicer\Lib;
  3. use Dever;
  4. class Manage
  5. {
  6. public function __construct()
  7. {
  8. Dever::load('manage/auth.init');
  9. }
  10. # 获取订单信息
  11. public function info($type = 'in', $id)
  12. {
  13. Dever::load('manage/auth.init');
  14. $info = Dever::db('scm_servicer/'.$type.'_order')->find($id);
  15. $string = '';
  16. $string = $info['order_num'];
  17. $servicer = Dever::db('scm_servicer/info')->one($info['servicer_id']);
  18. $string .= '<br />' . $servicer['name'];
  19. $store = Dever::db('scm_servicer/store')->one($info['servicer_store_id']);
  20. $string .= '.' . $store['name'];
  21. if (isset($info['supplier_id'])) {
  22. $supplier = Dever::db('scm_supplier/info')->one($info['supplier_id']);
  23. $string .= '<br />' . $supplier['name'];
  24. }
  25. $type = Dever::db('scm_servicer/'.$type.'_order_type')->one($info['type']);
  26. $string .= '<br />' . $type['name'];
  27. $string .= '<br />' . $info['info'];
  28. return $string;
  29. }
  30. # 查看详情
  31. public function show()
  32. {
  33. $type = Dever::input('type');
  34. return Dever::load('scm/lib/order')->show('scm_servicer/'.$type.'_order', 'scm_servicer/info', 'servicer_id', '配送商');
  35. }
  36. public function getStore($id)
  37. {
  38. $table = array();
  39. $table['head'] = array('仓库名称', '仓库编码', '操作');
  40. $table['body'] = array();
  41. $data = Dever::db('scm_servicer/store')->select(array('servicer_id' => $id));
  42. if ($data) {
  43. $status = Dever::db('scm_servicer/store')->config['status'];
  44. foreach ($data as $k => $v) {
  45. $status_name = '';
  46. if ($v['status'] == 2) {
  47. $status_name = '(已禁用)';
  48. }
  49. $url = Dever::url('project/database/update?project=scm_servicer&table=store&oper_save_table=info&set=1&where_id='.$v['id'], 'manage');
  50. $oper = '<a class="layui-btn" onclick="fastEdit($(this),\''.$url.'\',\'编辑仓库信息\', \'\')">编辑</a>';
  51. $url = Dever::url('project/database/list?project=scm_servicer&table=store_goods&oper_table=info&top_table1=info&search_option_servicer_store_id='.$v['id'], 'manage');
  52. $oper .= '<a class="layui-btn" href="'.$url.'">库存清单</a>';
  53. $table['body'][$k][] = $v['name'] . $status_name;
  54. $table['body'][$k][] = $v['code'];
  55. $table['body'][$k][] = $oper;
  56. }
  57. }
  58. $body[''] = array
  59. (
  60. 'type' => 'table',
  61. 'content' => $table,
  62. );
  63. if ($table['body']) {
  64. return Dever::show('', $body);
  65. } else {
  66. return '暂无';
  67. }
  68. }
  69. }