多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
### 通过订单类型获取订单信息 **位置:** Common\Lib\FlowLib.class.php **参数:** * @param $where array 订单类型条件(如:订单类型:1、配货单,2、调拨单,3、退仓单,4、移库单,订单号,状态) * @return $order_arr array 订单信息数组 **调用:** * $flow = new FlowLib(); * $order_arr = $flow->orderList($where); **完整代码:** ~~~ /** * 订单列表信息 调用的封装 * @param $where array 订单查询条件 * @return array 订单信息数组 * whz 2018-01-24 * */ public function orderList($where) { //1、统计订单总条数 $count = M('wms_flow')->where($where)->count(); //2、调用分页函数 $page = getpage($count, C('PAGE_SIZE')); //3、查询订单信息 $list = M("wms_flow") ->where($where) ->order("create_time desc") ->limit($page->firstRow, $page->listRows) ->select(); //记录每个订单商品数量 foreach ($list as $k =>$v) { $good_num = M('wms_no') ->where(array('is_delete'=>0, 'status'=>array('in',array(1,2)), 'order_id'=>$v['id'])) ->count(); $list[$k]['good_num'] = $good_num; } //4、返回数据 $order_arr['page'] = $page; $order_arr['list'] = $list; return $order_arr; } ~~~