1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <?php
-
-
- namespace app\home\model;
-
- use think\Model;
- use think\Db;
-
-
- class Single extends Model
- {
-
- protected function initialize()
- {
-
- parent::initialize();
- }
-
-
-
- public function getInfoByTypeid($typeid)
- {
- $cacheKey = md5("home_model_Single_getInfoByTypeid_{$typeid}");
- $result = cache($cacheKey);
- if (empty($result)) {
- $field = 'c.*, b.*, a.*, b.aid, a.id as typeid';
- $result = M('arctype')->field($field)
- ->alias('a')
- ->join('__ARCHIVES__ b', 'b.typeid = a.id', 'LEFT')
- ->join('__SINGLE_CONTENT__ c', 'c.aid = b.aid', 'LEFT')
- ->where('b.channel', 6)
- ->find($typeid);
-
- cache($cacheKey, $result, null, "arctype");
- }
-
- return $result;
- }
- }
|