123456789101112131415161718192021222324252627282930 |
- <?php
- namespace app\admin\controller;
- use app\common\util\ExcelUtil;
- use think\Db;
- class Test extends Auth
- {
- public function index(){
- $data = Db::name('device_record')
- ->alias('dr')
- ->join('device d', 'd.id=dr.device_id')
- ->field('dr.*,d.title as device_name,d.content as device_details')
- ->where('dr.org_id',$this->orgId)
- ->where('cate_id','in',[22,23])
- ->order('dr.id desc')
- ->limit(30)
- ->select();
- foreach ($data as $k=>$v){
- $img = explode(',',$v['images']);
- if($img){
- $data[$k]['images'] = $img[0];
- }
- }
- halt($data);
- HelpHander::success($data);
- }
- }
|