getInfo($id); $this->title = '【' . $info['name'] . '】订单列表'; $query = $this->_query($this->table); $query->equal('cid,pid,mid,order_id,merchant_order_id,status')->dateBetween('create_at'); // 加载对应数据列表 $this->type = input('type', 'all'); $query->where(['mid' => $id]); // 列表排序并显示 $query->order('create_at desc')->page(); } /** * 查看详细数据 * @login true * @auth true * @param integer $id * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException */ public function info() { $this->_applyFormToken(); $this->verify = false; $this->_form($this->table, 'info'); } /** * 表单数据处理 * @param array $data * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException */ protected function _form_filter(&$data) { } /** * 列表数据处理 * @param array $data * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException */ protected function _index_page_filter(array &$data) { $order = OrderService::instance(); $channel = ChannelService::instance(); $product = ProductService::instance(); $channel_list = $product_list = array(); foreach ($data as $k => $v) { if (!isset($channel_list[$v['cid']])) { $channel_list[$v['cid']] = $channel->getInfo($v['cid']); } $data[$k]['channel'] = $channel_list[$v['cid']]; if (!isset($product_list[$v['pid']])) { $product_list[$v['pid']] = $product->getInfo($v['pid']); } $data[$k]['product'] = $product_list[$v['pid']]; if ($v['status'] == 1) { $data[$k]['status_name'] = '进行中'; } elseif ($v['status'] == 2) { $data[$k]['status_name'] = '已完成'; } elseif ($v['status'] == 3) { $data[$k]['status_name'] = '失败'; } elseif ($v['status'] == 4) { $data[$k]['status_name'] = '处理中'; } elseif ($v['status'] == 5) { $data[$k]['status_name'] = '存疑'; } } } }