<?php
/**
 * Copyright (C) LJCMS All rights reserved.
 * <E-Mail：aspcms@qq.com>
 * Url http://www.liangjing.org
 *     http://www.8CMS.com
 * Update 2016.03.19
 */

class orderSModel extends X {

        public function getList($items) {
            $where      = " WHERE 1=1".$items['searchsql'];
            $start      = ($items['page']-1)*$items['pagesize'];
            $countsql   = "SELECT COUNT(v.id) FROM ".DB_PREFIX."order_info AS v".$where;
            $total      = parent::$obj->fetch_count($countsql);
            $sql        = "SELECT v.*,g.username".
                          " FROM ".DB_PREFIX."order_info AS v".
                          " LEFT JOIN ".DB_PREFIX."member AS g ON v.user_id=g.userid".
                          $where." ORDER BY v.id DESC LIMIT ".$start.", ".$items['pagesize']."";

            $array = parent::$obj->getall($sql);
        
            return array($total, $array);
        }

        
}
?>
