Manage.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <?php
  2. namespace Scm_seller\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. $info = Dever::db('scm_seller/'.$type.'_order')->find($id);
  14. $string = '';
  15. $string = $info['order_num'];
  16. $seller = Dever::db('scm_seller/info')->one($info['seller_id']);
  17. $string .= '<br />' . $seller['name'];
  18. $shop = Dever::db('scm_seller/shop')->one($info['seller_shop_id']);
  19. $string .= '.' . $shop['name'];
  20. if (isset($info['supplier_id'])) {
  21. $supplier = Dever::db('scm_supplier/info')->one($info['supplier_id']);
  22. $string .= '<br />' . $supplier['name'];
  23. }
  24. if (isset($info['servicer_id'])) {
  25. $servicer = Dever::db('scm_servicer/info')->one($info['servicer_id']);
  26. $string .= '<br />' . $servicer['name'];
  27. if (isset($info['servicer_store_id'])) {
  28. $store = Dever::db('scm_servicer/store')->one($info['servicer_store_id']);
  29. $string .= '.' . $store['name'];
  30. }
  31. }
  32. if ($type == 'in' || $type == 'out') {
  33. $type = Dever::db('scm_seller/'.$type.'_order_type')->one($info['type']);
  34. $string .= '<br />' . $type['name'];
  35. }
  36. $string .= '<br />' . $info['info'];
  37. return $string;
  38. }
  39. # 查看详情
  40. public function show()
  41. {
  42. $type = Dever::input('type');
  43. return Dever::load('scm/lib/order')->show('scm_seller/'.$type.'_order', 'scm_seller/info', 'seller_id', '经销商');
  44. }
  45. public function getShop($id)
  46. {
  47. $table = array();
  48. $table['head'] = array('门店名称', '门店编码', '操作');
  49. $table['body'] = array();
  50. $data = Dever::db('scm_seller/shop')->select(array('seller_id' => $id));
  51. if ($data) {
  52. $status = Dever::db('scm_seller/shop')->config['status'];
  53. foreach ($data as $k => $v) {
  54. $status_name = '';
  55. if ($v['status'] == 2) {
  56. $status_name = '(已禁用)';
  57. }
  58. $url = Dever::url('project/database/update?project=scm_seller&table=shop&oper_save_table=info&set=1&where_id='.$v['id'], 'manage');
  59. $oper = '<a class="layui-btn" onclick="fastEdit($(this),\''.$url.'\',\'编辑门店信息\', \'\')">编辑</a>';
  60. $url = Dever::url('project/database/list?project=scm_seller&table=shop_goods&oper_table=info&search_option_seller_shop_id='.$v['id'], 'manage');
  61. $oper .= '<a class="layui-btn" href="'.$url.'">商品清单</a>';
  62. $url = Dever::url('lib/set_store.home?role=seller&table=shop', 'scm_servicer');
  63. $oper .= '<a class="layui-btn" href="'.$url.'">分配仓库</a>';
  64. $table['body'][$k][] = $v['name'] . $status_name;
  65. $table['body'][$k][] = $v['code'];
  66. $table['body'][$k][] = $oper;
  67. }
  68. }
  69. $body[''] = array
  70. (
  71. 'type' => 'table',
  72. 'content' => $table,
  73. );
  74. if ($table['body']) {
  75. return Dever::show('', $body);
  76. } else {
  77. return '暂无';
  78. }
  79. }
  80. }