=', strtotime($get['start_time'])]; } if (isset($get['end_time']) && $get['end_time'] != '') { $where[] = ['o.create_time', '<=', strtotime($get['end_time'])]; } return $where; } /** * Notes: 日式保洁订单 * @param $get * @author 段誉(2021/2/1 10:12) * @return array */ public static function cleaning($get) { $order = new Order(); $where = self::getListsCondition($get); $field = 'o.*,order_status as order_status_text,pay_way as pay_way_text'; $brand = Db::name('goods_brand')->where(['del'=>0])->column('name','id'); //订单类型 $admin=Db::name('admin')->column('name','id'); $count = $order ->alias('o') ->join('goods g', 'o.goods_id = g.id') ->where('g.brand_id', 1) ->where($where) ->count(); $lists = $order ->alias('o') ->join('goods g', 'o.goods_id = g.id') ->where($where) ->where('g.brand_id', 1) ->field('o.*') ->page($get['page'], $get['limit']) ->order('o.id desc') ->select(); $channel = Db::name('orderchannel')->column('name','id'); foreach ($lists as &$item){ if(isset($channel[$item['channel_id']])){ $item['channel'] = $channel[$item['channel_id']]; } if(isset($brand[$item['type_id']])){ $item['brand'] = $brand[$item['type_id']]; } if(isset($admin[$item['admin_id']])){ $item['admin_id'] = $admin[$item['admin_id']]; } //获取订单的商品 $goods=GoodsLogic::goodsinfo($item['goods_id']); if($goods){ $item['goods_name']=$goods['name']; $item['goods_image']=UrlServer::getFileUrl($goods['image']); $item['code']=$goods['code']; }else{ $item['goods_name']=''; $item['goods_image']=''; $item['code']=''; } $gord_id=Db::name('collection')->where('id',$item['gord_id'])->find(); if($gord_id){ $item['gord_name']= $gord_id['cqname']; }else{ $item['gord_name']='-'; } } return ['count' => $count, 'lists' => $lists]; } /** * Notes: 收纳整理 * @param $get * @author 段誉(2021/2/1 10:12) * @return array */ public static function storage($get) { $order = new Order(); $where = self::getListsCondition($get); $field = 'o.*,order_status as order_status_text,pay_way as pay_way_text'; $brand = Db::name('goods_brand')->where(['del'=>0])->column('name','id'); //订单类型 $admin=Db::name('admin')->column('name','id'); $count = $order ->alias('o') ->join('goods g', 'o.goods_id = g.id') ->where('g.brand_id', 2) ->where($where) ->count(); $lists = $order ->alias('o') ->join('goods g', 'o.goods_id = g.id') ->where($where) ->where('g.brand_id', 2) ->field('o.*') ->page($get['page'], $get['limit']) ->order('o.id desc') ->select(); $channel = Db::name('orderchannel')->column('name','id'); foreach ($lists as &$item){ if(isset($channel[$item['channel_id']])){ $item['channel'] = $channel[$item['channel_id']]; } if(isset($brand[$item['type_id']])){ $item['brand'] = $brand[$item['type_id']]; } if(isset($admin[$item['admin_id']])){ $item['admin_id'] = $admin[$item['admin_id']]; } //获取订单的商品 $goods=GoodsLogic::goodsinfo($item['goods_id']); if($goods){ $item['goods_name']=$goods['name']; $item['goods_image']=UrlServer::getFileUrl($goods['image']); $item['code']=$goods['code']; }else{ $item['goods_name']=''; $item['goods_image']=''; $item['code']=''; } $gord_id=Db::name('collection')->where('id',$item['gord_id'])->find(); if($gord_id){ $item['gord_name']= $gord_id['cqname']; }else{ $item['gord_name']='-'; } } return ['count' => $count, 'lists' => $lists]; } /** * Notes: 深度清洗 * @param $get * @author 段誉(2021/2/1 10:12) * @return array */ public static function depth($get) { $order = new Order(); $where = self::getListsCondition($get); $field = 'o.*,order_status as order_status_text,pay_way as pay_way_text'; $brand = Db::name('goods_brand')->where(['del'=>0])->column('name','id'); //订单类型 $admin=Db::name('admin')->column('name','id'); $count = $order ->alias('o') ->join('goods g', 'o.goods_id = g.id') ->where('g.brand_id', 4) ->where($where) ->count(); $lists = $order ->alias('o') ->join('goods g', 'o.goods_id = g.id') ->where($where) ->where('g.brand_id', 4) ->field('o.*') ->page($get['page'], $get['limit']) ->order('o.id desc') ->select(); $channel = Db::name('orderchannel')->column('name','id'); foreach ($lists as &$item){ if(isset($channel[$item['channel_id']])){ $item['channel'] = $channel[$item['channel_id']]; } if(isset($brand[$item['type_id']])){ $item['brand'] = $brand[$item['type_id']]; } if(isset($admin[$item['admin_id']])){ $item['admin_id'] = $admin[$item['admin_id']]; } //获取订单的商品 $goods=GoodsLogic::goodsinfo($item['goods_id']); if($goods){ $item['goods_name']=$goods['name']; $item['goods_image']=UrlServer::getFileUrl($goods['image']); $item['code']=$goods['code']; }else{ $item['goods_name']=''; $item['goods_image']=''; $item['code']=''; } $gord_id=Db::name('collection')->where('id',$item['gord_id'])->find(); if($gord_id){ $item['gord_name']= $gord_id['cqname']; }else{ $item['gord_name']='-'; } } return ['count' => $count, 'lists' => $lists]; } /** * Notes: 宠物保洁 * @param $get * @author 段誉(2021/2/1 10:12) * @return array */ public static function pet($get) { $order = new Order(); $where = self::getListsCondition($get); $field = 'o.*,order_status as order_status_text,pay_way as pay_way_text'; $brand = Db::name('goods_brand')->where(['del'=>0])->column('name','id'); //订单类型 $admin=Db::name('admin')->column('name','id'); $count = $order ->alias('o') ->join('goods g', 'o.goods_id = g.id') ->where('g.brand_id', 5) ->where($where) ->count(); $lists = $order ->alias('o') ->join('goods g', 'o.goods_id = g.id') ->where($where) ->where('g.brand_id', 5) ->field('o.*') ->page($get['page'], $get['limit']) ->order('o.id desc') ->select(); $channel = Db::name('orderchannel')->column('name','id'); foreach ($lists as &$item){ if(isset($channel[$item['channel_id']])){ $item['channel'] = $channel[$item['channel_id']]; } if(isset($brand[$item['type_id']])){ $item['brand'] = $brand[$item['type_id']]; } if(isset($admin[$item['admin_id']])){ $item['admin_id'] = $admin[$item['admin_id']]; } //获取订单的商品 $goods=GoodsLogic::goodsinfo($item['goods_id']); if($goods){ $item['goods_name']=$goods['name']; $item['goods_image']=UrlServer::getFileUrl($goods['image']); $item['code']=$goods['code']; }else{ $item['goods_name']=''; $item['goods_image']=''; $item['code']=''; } $gord_id=Db::name('collection')->where('id',$item['gord_id'])->find(); if($gord_id){ $item['gord_name']= $gord_id['cqname']; }else{ $item['gord_name']='-'; } } return ['count' => $count, 'lists' => $lists]; } /** * Notes: 宠物保洁 * @param $get * @author 段誉(2021/2/1 10:12) * @return array */ public static function cooking($get) { $order = new Order(); $where = self::getListsCondition($get); $field = 'o.*,order_status as order_status_text,pay_way as pay_way_text'; $brand = Db::name('goods_brand')->where(['del'=>0])->column('name','id'); //订单类型 $admin=Db::name('admin')->column('name','id'); $count = $order ->alias('o') ->join('goods g', 'o.goods_id = g.id') ->where('g.brand_id', 3) ->where($where) ->count(); $lists = $order ->alias('o') ->join('goods g', 'o.goods_id = g.id') ->where($where) ->where('g.brand_id', 3) ->field('o.*') ->page($get['page'], $get['limit']) ->order('o.id desc') ->select(); $channel = Db::name('orderchannel')->column('name','id'); foreach ($lists as &$item){ if(isset($channel[$item['channel_id']])){ $item['channel'] = $channel[$item['channel_id']]; } if(isset($brand[$item['type_id']])){ $item['brand'] = $brand[$item['type_id']]; } if(isset($admin[$item['admin_id']])){ $item['admin_id'] = $admin[$item['admin_id']]; } //获取订单的商品 $goods=GoodsLogic::goodsinfo($item['goods_id']); if($goods){ $item['goods_name']=$goods['name']; $item['goods_image']=UrlServer::getFileUrl($goods['image']); $item['code']=$goods['code']; }else{ $item['goods_name']=''; $item['goods_image']=''; $item['code']=''; } $gord_id=Db::name('collection')->where('id',$item['gord_id'])->find(); if($gord_id){ $item['gord_name']= $gord_id['cqname']; }else{ $item['gord_name']='-'; } } return ['count' => $count, 'lists' => $lists]; } /** * Notes: 粗开荒保洁 * @param $get * @author 段誉(2021/2/1 10:12) * @return array */ public static function thick($get) { $order = new Order(); $where = self::getListsCondition($get); $field = 'o.*,order_status as order_status_text,pay_way as pay_way_text'; $brand = Db::name('goods_brand')->where(['del'=>0])->column('name','id'); //订单类型 $admin=Db::name('admin')->column('name','id'); $count = $order ->alias('o') ->join('goods g', 'o.goods_id = g.id') ->where('g.brand_id', 6) ->where($where) ->count(); $lists = $order ->alias('o') ->join('goods g', 'o.goods_id = g.id') ->where($where) ->where('g.brand_id', 6) ->field('o.*') ->page($get['page'], $get['limit']) ->order('o.id desc') ->select(); $channel = Db::name('orderchannel')->column('name','id'); foreach ($lists as &$item){ if(isset($channel[$item['channel_id']])){ $item['channel'] = $channel[$item['channel_id']]; } if(isset($brand[$item['type_id']])){ $item['brand'] = $brand[$item['type_id']]; } if(isset($admin[$item['admin_id']])){ $item['admin_id'] = $admin[$item['admin_id']]; } //获取订单的商品 $goods=GoodsLogic::goodsinfo($item['goods_id']); if($goods){ $item['goods_name']=$goods['name']; $item['goods_image']=UrlServer::getFileUrl($goods['image']); $item['code']=$goods['code']; }else{ $item['goods_name']=''; $item['goods_image']=''; $item['code']=''; } $gord_id=Db::name('collection')->where('id',$item['gord_id'])->find(); if($gord_id){ $item['gord_name']= $gord_id['cqname']; }else{ $item['gord_name']='-'; } } return ['count' => $count, 'lists' => $lists]; } /** * Notes: 细开荒保洁 * @param $get * @author 段誉(2021/2/1 10:12) * @return array */ public static function fine($get) { $order = new Order(); $where = self::getListsCondition($get); $field = 'o.*,order_status as order_status_text,pay_way as pay_way_text'; $brand = Db::name('goods_brand')->where(['del'=>0])->column('name','id'); //订单类型 $admin=Db::name('admin')->column('name','id'); $count = $order ->alias('o') ->join('goods g', 'o.goods_id = g.id') ->where('g.brand_id', 7) ->where($where) ->count(); $lists = $order ->alias('o') ->join('goods g', 'o.goods_id = g.id') ->where($where) ->where('g.brand_id',7) ->field('o.*') ->page($get['page'], $get['limit']) ->order('o.id desc') ->select(); $channel = Db::name('orderchannel')->column('name','id'); foreach ($lists as &$item){ if(isset($channel[$item['channel_id']])){ $item['channel'] = $channel[$item['channel_id']]; } if(isset($brand[$item['type_id']])){ $item['brand'] = $brand[$item['type_id']]; } if(isset($admin[$item['admin_id']])){ $item['admin_id'] = $admin[$item['admin_id']]; } //获取订单的商品 $goods=GoodsLogic::goodsinfo($item['goods_id']); if($goods){ $item['goods_name']=$goods['name']; $item['goods_image']=UrlServer::getFileUrl($goods['image']); $item['code']=$goods['code']; }else{ $item['goods_name']=''; $item['goods_image']=''; $item['code']=''; } $gord_id=Db::name('collection')->where('id',$item['gord_id'])->find(); if($gord_id){ $item['gord_name']= $gord_id['cqname']; }else{ $item['gord_name']='-'; } } return ['count' => $count, 'lists' => $lists]; } /** * Notes: 搬家货运 * @param $get * @author 段誉(2021/2/1 10:12) * @return array */ public static function move($get) { $order = new Order(); $where = self::getListsCondition($get); $field = 'o.*,order_status as order_status_text,pay_way as pay_way_text'; $brand = Db::name('goods_brand')->where(['del'=>0])->column('name','id'); //订单类型 $admin=Db::name('admin')->column('name','id'); $count = $order ->alias('o') ->join('goods g', 'o.goods_id = g.id') ->where('g.brand_id', 8) ->where($where) ->count(); $lists = $order ->alias('o') ->join('goods g', 'o.goods_id = g.id') ->where($where) ->where('g.brand_id',8) ->field('o.*') ->page($get['page'], $get['limit']) ->order('o.id desc') ->select(); $channel = Db::name('orderchannel')->column('name','id'); foreach ($lists as &$item){ if(isset($channel[$item['channel_id']])){ $item['channel'] = $channel[$item['channel_id']]; } if(isset($brand[$item['type_id']])){ $item['brand'] = $brand[$item['type_id']]; } if(isset($admin[$item['admin_id']])){ $item['admin_id'] = $admin[$item['admin_id']]; } //获取订单的商品 $goods=GoodsLogic::goodsinfo($item['goods_id']); if($goods){ $item['goods_name']=$goods['name']; $item['goods_image']=UrlServer::getFileUrl($goods['image']); $item['code']=$goods['code']; }else{ $item['goods_name']=''; $item['goods_image']=''; $item['code']=''; } $gord_id=Db::name('collection')->where('id',$item['gord_id'])->find(); if($gord_id){ $item['gord_name']= $gord_id['cqname']; }else{ $item['gord_name']='-'; } } return ['count' => $count, 'lists' => $lists]; } /** * Notes: 搬家货运 * @param $get * @author 段誉(2021/2/1 10:12) * @return array */ public static function detection($get) { $order = new Order(); $where = self::getListsCondition($get); $field = 'o.*,order_status as order_status_text,pay_way as pay_way_text'; $brand = Db::name('goods_brand')->where(['del'=>0])->column('name','id'); //订单类型 $admin=Db::name('admin')->column('name','id'); $count = $order ->alias('o') ->join('goods g', 'o.goods_id = g.id') ->where('g.brand_id', 9) ->where($where) ->count(); $lists = $order ->alias('o') ->join('goods g', 'o.goods_id = g.id') ->where($where) ->where('g.brand_id',9) ->field('o.*') ->page($get['page'], $get['limit']) ->order('o.id desc') ->select(); $channel = Db::name('orderchannel')->column('name','id'); foreach ($lists as &$item){ if(isset($channel[$item['channel_id']])){ $item['channel'] = $channel[$item['channel_id']]; } if(isset($brand[$item['type_id']])){ $item['brand'] = $brand[$item['type_id']]; } if(isset($admin[$item['admin_id']])){ $item['admin_id'] = $admin[$item['admin_id']]; } //获取订单的商品 $goods=GoodsLogic::goodsinfo($item['goods_id']); if($goods){ $item['goods_name']=$goods['name']; $item['goods_image']=UrlServer::getFileUrl($goods['image']); $item['code']=$goods['code']; }else{ $item['goods_name']=''; $item['goods_image']=''; $item['code']=''; } $gord_id=Db::name('collection')->where('id',$item['gord_id'])->find(); if($gord_id){ $item['gord_name']= $gord_id['cqname']; }else{ $item['gord_name']='-'; } } return ['count' => $count, 'lists' => $lists]; } /** * Notes: 空气治理 * @param $get * @author 段誉(2021/2/1 10:12) * @return array */ public static function governance($get) { $order = new Order(); $where = self::getListsCondition($get); $field = 'o.*,order_status as order_status_text,pay_way as pay_way_text'; $brand = Db::name('goods_brand')->where(['del'=>0])->column('name','id'); //订单类型 $admin=Db::name('admin')->column('name','id'); $count = $order ->alias('o') ->join('goods g', 'o.goods_id = g.id') ->where('g.brand_id', 10) ->where($where) ->count(); $lists = $order ->alias('o') ->join('goods g', 'o.goods_id = g.id') ->where($where) ->where('g.brand_id',10) ->field('o.*') ->page($get['page'], $get['limit']) ->order('o.id desc') ->select(); $channel = Db::name('orderchannel')->column('name','id'); foreach ($lists as &$item){ if(isset($channel[$item['channel_id']])){ $item['channel'] = $channel[$item['channel_id']]; } if(isset($brand[$item['type_id']])){ $item['brand'] = $brand[$item['type_id']]; } if(isset($admin[$item['admin_id']])){ $item['admin_id'] = $admin[$item['admin_id']]; } //获取订单的商品 $goods=GoodsLogic::goodsinfo($item['goods_id']); if($goods){ $item['goods_name']=$goods['name']; $item['goods_image']=UrlServer::getFileUrl($goods['image']); $item['code']=$goods['code']; }else{ $item['goods_name']=''; $item['goods_image']=''; $item['code']=''; } $gord_id=Db::name('collection')->where('id',$item['gord_id'])->find(); if($gord_id){ $item['gord_name']= $gord_id['cqname']; }else{ $item['gord_name']='-'; } } return ['count' => $count, 'lists' => $lists]; } /** * Notes: 空气治理 * @param $get * @author 段誉(2021/2/1 10:12) * @return array */ public static function wash($get) { $order = new Order(); $where = self::getListsCondition($get); $field = 'o.*,order_status as order_status_text,pay_way as pay_way_text'; $brand = Db::name('goods_brand')->where(['del'=>0])->column('name','id'); //订单类型 $admin=Db::name('admin')->column('name','id'); $count = $order ->alias('o') ->join('goods g', 'o.goods_id = g.id') ->where('g.brand_id', 11) ->where($where) ->count(); $lists = $order ->alias('o') ->join('goods g', 'o.goods_id = g.id') ->where($where) ->where('g.brand_id',11) ->field('o.*') ->page($get['page'], $get['limit']) ->order('o.id desc') ->select(); $channel = Db::name('orderchannel')->column('name','id'); foreach ($lists as &$item){ if(isset($channel[$item['channel_id']])){ $item['channel'] = $channel[$item['channel_id']]; } if(isset($brand[$item['type_id']])){ $item['brand'] = $brand[$item['type_id']]; } if(isset($admin[$item['admin_id']])){ $item['admin_id'] = $admin[$item['admin_id']]; } //获取订单的商品 $goods=GoodsLogic::goodsinfo($item['goods_id']); if($goods){ $item['goods_name']=$goods['name']; $item['goods_image']=UrlServer::getFileUrl($goods['image']); $item['code']=$goods['code']; }else{ $item['goods_name']=''; $item['goods_image']=''; $item['code']=''; } $gord_id=Db::name('collection')->where('id',$item['gord_id'])->find(); if($gord_id){ $item['gord_name']= $gord_id['cqname']; }else{ $item['gord_name']='-'; } } return ['count' => $count, 'lists' => $lists]; } /** * Notes: 清洗 * @param $get * @author 段誉(2021/2/1 10:12) * @return array */ public static function linen($get) { $order = new Order(); $where = self::getListsCondition($get); $field = 'o.*,order_status as order_status_text,pay_way as pay_way_text'; $brand = Db::name('goods_brand')->where(['del'=>0])->column('name','id'); //订单类型 $admin=Db::name('admin')->column('name','id'); $count = $order ->alias('o') ->join('goods g', 'o.goods_id = g.id') ->where('g.brand_id', 13) ->where($where) ->count(); $lists = $order ->alias('o') ->join('goods g', 'o.goods_id = g.id') ->where($where) ->where('g.brand_id',13) ->field('o.*') ->page($get['page'], $get['limit']) ->order('o.id desc') ->select(); $channel = Db::name('orderchannel')->column('name','id'); foreach ($lists as &$item){ if(isset($channel[$item['channel_id']])){ $item['channel'] = $channel[$item['channel_id']]; } if(isset($brand[$item['type_id']])){ $item['brand'] = $brand[$item['type_id']]; } if(isset($admin[$item['admin_id']])){ $item['admin_id'] = $admin[$item['admin_id']]; } //获取订单的商品 $goods=GoodsLogic::goodsinfo($item['goods_id']); if($goods){ $item['goods_name']=$goods['name']; $item['goods_image']=UrlServer::getFileUrl($goods['image']); $item['code']=$goods['code']; }else{ $item['goods_name']=''; $item['goods_image']=''; $item['code']=''; } $gord_id=Db::name('collection')->where('id',$item['gord_id'])->find(); if($gord_id){ $item['gord_name']= $gord_id['cqname']; }else{ $item['gord_name']='-'; } } return ['count' => $count, 'lists' => $lists]; } /** * Notes: 宠物保洁订单 * @param $get * @author 段誉(2021/2/1 10:12) * @return array */ public static function pets($get) { $order = new Order(); $where = self::getListsCondition($get); $field = 'o.*,order_status as order_status_text,pay_way as pay_way_text'; $brand = Db::name('goods_brand')->where(['del'=>0])->column('name','id'); //订单类型 $admin=Db::name('admin')->column('name','id'); $count = $order ->alias('o') ->join('goods g', 'o.goods_id = g.id') ->where('g.brand_id', 14) ->where($where) ->count(); $lists = $order ->alias('o') ->join('goods g', 'o.goods_id = g.id') ->where($where) ->where('g.brand_id',14) ->field('o.*') ->page($get['page'], $get['limit']) ->order('o.id desc') ->select(); $channel = Db::name('orderchannel')->column('name','id'); foreach ($lists as &$item){ if(isset($channel[$item['channel_id']])){ $item['channel'] = $channel[$item['channel_id']]; } if(isset($brand[$item['type_id']])){ $item['brand'] = $brand[$item['type_id']]; } if(isset($admin[$item['admin_id']])){ $item['admin_id'] = $admin[$item['admin_id']]; } //获取订单的商品 $goods=GoodsLogic::goodsinfo($item['goods_id']); if($goods){ $item['goods_name']=$goods['name']; $item['goods_image']=UrlServer::getFileUrl($goods['image']); $item['code']=$goods['code']; }else{ $item['goods_name']=''; $item['goods_image']=''; $item['code']=''; } $gord_id=Db::name('collection')->where('id',$item['gord_id'])->find(); if($gord_id){ $item['gord_name']= $gord_id['cqname']; }else{ $item['gord_name']='-'; } } return ['count' => $count, 'lists' => $lists]; } }