123456789101112131415161718192021222324252627282930313233343536 |
- <?php
- namespace Push\Lib;
- use Dever;
- class Manage
- {
- //{source_id} > 0 ? ("{name}" ? "{name}" : Dever::load("sad/supply-one#name", {source_id})) : "{name}"
- public function col($id, $col = 'name')
- {
- $info = Dever::db('push/data')->one($id);
- if ($info[$col]) {
- return $info[$col];
- }
- if ($info['type'] < 10) {
- $table = Dever::config('base')->table_name[$info['type']];
- $id = $table[1];
- $where = array
- (
- 'status' => 1,
- 'state' => 1,
- );
- $where['id'] = $info[$id];
- $data = Dever::db($table[0])->one($where);
- if (isset($data) && $data && isset($data[$col])) {
- return $data[$col];
- }
- }
- return $info[$col];
- }
- }
|