where(['user_id' => $this->auth->id, 'type' => $type]) ->where('createtime','> time',date('Y-m-d',time()-2592000)) ->order('createtime desc') ->paginate() ->each(function($order, $key){ // 类型:order=订单,refund=退款,groupsorder=拼团订单,groupsrefund=拼团退款,live=直播,goods=商品 switch ($order['modules']) { // 订单模块 case 'order': $order['url'] = '/pages/user/order/details?id='.$order['modules_id']; break; // 退款模块 case 'refund': $order['url'] = '/pages/user/refund/details?id='.$order['modules_id']; break; // 拼团订单模块 case 'groupsorder': $order['url'] = '/pages/apps/groups/order/details?id='.$order['modules_id']; break; // 拼团退款模块 case 'groupsrefund': $order['url'] = '/pages/user/refund/details?id='.$order['modules_id']; break; // 直播模块 case 'live': $order['url'] = '/pages/wanlshop/no_network?id='.$order['modules_id']; break; // 商品模块 case 'goods': $order['url'] = '/pages/product/goods?id='.$order['modules_id']; break; // 后续版本继续更新更多提示内容,和商家推送 } return $order; }); $list?($this->success('ok',$list)):($this->error(__('网络繁忙'))); } }