本文整理汇总了PHP中OrderDetail::instance方法的典型用法代码示例。如果您正苦于以下问题:PHP OrderDetail::instance方法的具体用法?PHP OrderDetail::instance怎么用?PHP OrderDetail::instance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OrderDetail
的用法示例。
在下文中一共展示了OrderDetail::instance方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
parent::__construct();
if ($this->is_ajax_request() == TRUE) {
$this->template = new View('layout/default_json');
}
role::check('orders');
$this->order_basic_obj = OrderBasic::instance();
$this->order_detail_obj = OrderDetail::instance();
}
示例2: __construct
public function __construct()
{
parent::__construct();
$this->obj_user_help = userfunc::get_instance();
$this->obj_order = order::get_instance();
$this->obj_orderbasic = OrderBasic::instance();
$this->obj_orderdetail = OrderDetail::instance();
if ($this->obj_user_help->is_login() == FALSE) {
//header('Location: http://'.$this->_site_config['site_config']['name'].'/user/login');
}
}
示例3: orderlist
public function orderlist()
{
if ($this->obj_user_help->is_login() == FALSE) {
header('Location: http://' . $this->_site_config['site_config']['name'] . '/user/login');
}
$obj_orderbasic = OrderBasic::instance();
$obj_orderdetail = OrderDetail::instance();
$get_page = $this->input->get('page');
$page = $get_page != FALSE ? intval($get_page) : "1";
//当前页码
$config['base_url'] = "/user/orderlist/";
$config['total_items'] = $obj_orderbasic->get_user_order_count($this->_user['id']);
//总数量
$config['query_string'] = 'page';
$config['items_per_page'] = 10;
//每页的数量
$config['uri_segment'] = $page;
$config['directory'] = "";
//样式路径
$query_struct = array('where' => array('uid' => $this->_user['id']), 'orderby' => array('id' => 'desc'), 'limit' => array('per_page' => $config['items_per_page'], 'offset' => $page));
$this->pagination = new Pagination($config);
$this->pagination->initialize();
$query_struct['limit']['offset'] = $this->pagination->sql_offset;
$data = $obj_orderbasic->lists($query_struct);
for ($i = 0; $i < count($data); $i++) {
$order_id = $data[$i]['id'];
$detail = $obj_orderdetail->get_orders_by_orderid($order_id);
$data[$i]['child_orders'] = $detail;
}
$view = new View('user/order_list');
$view->set("data", $data);
$view->render(TRUE);
}