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://linggong.jinjianghc.com/attachment/images/20221017/69ecf042019c1aa21d33e0d47cc9c535.png"],
- ['title'=>'按时','tilurl'=>url('/jobs/index').'?type=2','tilpic'=>"https://linggong.jinjianghc.com/attachment/images/20221017/a0aad83651786e8f4b58b8b58d294c5a.png"],
- ['title'=>'按件','tilurl'=>url('/jobs/index').'?type=3','tilpic'=>"https://linggong.jinjianghc.com/attachment/images/20221017/a0a399db96c6e0d0a6d7a3ced3491756.png"],
- ['title'=>'按项目','tilurl'=>url('/jobs/index').'?type=4','tilpic'=>"https://linggong.jinjianghc.com/attachment/images/20221017/240c1f65071343575bf06ccbb060ef40.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,
- ]
- );
- }
- }
|