Manage.php 838 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace Push\Lib;
  3. use Dever;
  4. class Manage
  5. {
  6. //{source_id} > 0 ? ("{name}" ? "{name}" : Dever::load("sad/supply-one#name", {source_id})) : "{name}"
  7. public function col($id, $col = 'name')
  8. {
  9. $info = Dever::db('push/data')->one($id);
  10. if ($info[$col]) {
  11. return $info[$col];
  12. }
  13. if ($info['type'] < 10) {
  14. $table = Dever::config('base')->table_name[$info['type']];
  15. $id = $table[1];
  16. $where = array
  17. (
  18. 'status' => 1,
  19. 'state' => 1,
  20. );
  21. $where['id'] = $info[$id];
  22. $data = Dever::db($table[0])->one($where);
  23. if (isset($data) && $data && isset($data[$col])) {
  24. return $data[$col];
  25. }
  26. }
  27. return $info[$col];
  28. }
  29. }