Role.php 783 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace Scm\Lib;
  3. use Dever;
  4. class Role
  5. {
  6. public function search_api()
  7. {
  8. $id = Dever::input('id');
  9. $keyword = Dever::input('keyword');
  10. $where = array();
  11. if ($keyword) {
  12. $where['name'] = $keyword;
  13. }
  14. $id = Dever::input('where_id');
  15. if ($id) {
  16. $where['id_no'] = $id;
  17. }
  18. $source_type = Dever::input('source_type', 1);
  19. if ($source_type == 1) {
  20. return Dever::search('scm_seller/info', $where);
  21. }
  22. if ($source_type == 2) {
  23. return Dever::search('scm_servicer/info', $where);
  24. }
  25. if ($source_type == 3) {
  26. return Dever::search('scm_supplier/info', $where);
  27. }
  28. }
  29. }