12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?php
- namespace app\mobile\controller;
- use app\common\model\SlideWoman as SlideModel;
- use app\common\model\Comjobs as ComjobsModel;
- use app\mobile\UserBaseController;
- class Index extends UserBaseController
- {
- public function index()
- {
- //轮播图
- $slide = SlideModel::where('pagetab', '=', 'woman')->order(['priority' => 'desc', 'id' => 'desc'])->limit(10)->select();
- //导航
- $navigation = [
- ['title'=>'按月','tilurl'=>url('/jobs/index').'?type=1','tilpic'=>"https://mw_odd_job.jucai.gov.cn/attachment/images/20230922/3ca26d61dddf8bfb745ad624b97dfac6.png"],
- ['title'=>'按时','tilurl'=>url('/jobs/index').'?type=2','tilpic'=>"https://mw_odd_job.jucai.gov.cn/attachment/images/20230922/0807346add3879c8ad38905c062ee4e2.png"],
- ['title'=>'按件','tilurl'=>url('/jobs/index').'?type=3','tilpic'=>"https://mw_odd_job.jucai.gov.cn/attachment/images/20230922/21840b966c01ad30d04d66cad991c899.png"],
- ['title'=>'按项目','tilurl'=>url('/jobs/index').'?type=4','tilpic'=>"https://mw_odd_job.jucai.gov.cn/attachment/images/20230922/531d76d74c996d81203ccd927cc6bd2f.png"],
- ];
- //列表
- $map = [];
- $map[] = ['createtime', '<=', time()];
- $map[] = ['priority', '>', 0];
- $map[] = ['status', 'in', '3,4'];
- $list = ComjobsModel::with(['worker'])->where($map)->order(['status' => 'asc', 'priority' => 'desc', 'updatetime' => 'desc', 'id' => 'desc'])->limit(10)->select();
- foreach ($list as $v) {
- $tags = [];
- foreach ($v['tags'] as $tag) {
- $tags = array_merge($tags,explode(',',$tag));
- }
- $v['tags'] = $tags;
- }
- return view('index/index', [
- 'slide' => $slide,
- 'navigation' => json_encode($navigation),
- 'list' => $list,
- ]
- );
- }
- }
|