Servicer.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. namespace Scm_role\Lib;
  3. use Dever;
  4. class Servicer
  5. {
  6. public function __construct()
  7. {
  8. Dever::load('manage/auth.init');
  9. }
  10. public function getStore($id)
  11. {
  12. $table = array();
  13. $table['head'] = array('仓库名称', '仓库编码', '操作');
  14. $table['body'] = array();
  15. $data = Dever::db('scm_role/servicer_store')->select(array('servicer_id' => $id));
  16. if ($data) {
  17. $status = Dever::db('scm_role/servicer_store')->config['status'];
  18. foreach ($data as $k => $v) {
  19. $status_name = '';
  20. if ($v['status'] == 2) {
  21. $status_name = '(已禁用)';
  22. }
  23. $oper = '<a class="layui-btn" href="'.Dever::url('lib/set.home?role=servicer_store&id=' . $v['id'], 'scm_role').'">商品列表</a>';
  24. $table['body'][$k][] = $v['name'] . $status_name;
  25. $table['body'][$k][] = $v['code'];
  26. $table['body'][$k][] = $oper;
  27. }
  28. }
  29. $body[''] = array
  30. (
  31. 'type' => 'table',
  32. 'content' => $table,
  33. );
  34. if ($table['body']) {
  35. return Dever::show('', $body);
  36. } else {
  37. return '暂无';
  38. }
  39. }
  40. }