示例#1
0
 public function __construct()
 {
     parent::__construct();
     $result = $this->db->simpleQuery()->from('shippment_methods', array('id'))->all();
     foreach ($result as $tab) {
         $this->shippment_m[] = new Shippment($tab['id']);
     }
 }
示例#2
0
 public function __construct()
 {
     parent::__construct();
     $result = $this->db->simpleQuery()->from('categories', array('category_id'))->all();
     foreach ($result as $tab) {
         $this->category_m[] = new Category($tab['category_id']);
     }
 }
示例#3
0
 public function __construct($id = null)
 {
     parent::__construct();
     if (!empty($id)) {
         $result = $this->db->simpleQuery()->from('promotions', array('id'))->where('product_id=?', $id)->all();
         foreach ($result as $tab) {
             $this->promotion_m = new Promotion($tab['id']);
         }
     }
 }
 public function __construct($id = null, $noLoad = false)
 {
     parent::__construct();
     $this->id = $id;
     if ($noLoad) {
         return $this;
     }
     if (!empty($id)) {
         $this->values = $this->db->simpleQuery()->from('product_additional_info', array('id', 'product_id', 'name', 'value'))->where('product_id=?', $this->id)->all();
     }
 }
示例#5
0
 public function __construct($id = null)
 {
     parent::__construct();
     if (!empty($id)) {
         $this->id = $id;
         $result = $this->db->simpleQuery()->from('page_id_category_id', array('page_id'))->where('category_id=?', $id)->all();
         foreach ($result as $tab) {
             $this->page_m[] = new Page($tab['page_id']);
         }
     }
 }
 public function __construct($email)
 {
     parent::__construct();
     $result = $this->db->simpleQuery()->from('users', array('id'))->where('email=?', $email)->first();
     if (count($result)) {
         $this->id = $result[0]['id'];
         $this->exist = true;
     } else {
         $this->exist = false;
     }
 }
示例#7
0
 public function __construct()
 {
     parent::__construct();
     $date = date("Y-m-d H:i:s", time() - 600);
     $result = $this->db->getAll("SELECT product_id, quantity FROM last_ordered WHERE date < '" . $date . "' AND active=0");
     if ($result) {
         echo "dddddd";
         $this->db->query('START TRANSACTION');
         $this->db->query("DELETE FROM last_ordered WHERE date < '" . $date . "' AND active=0");
         $this->db->query('COMMIT');
         foreach ($result as $product) {
             $this->db->query('START TRANSACTION');
             $id = $product["product_id"];
             $quantity = $product["quantity"];
             $this->db->query("UPDATE products SET product_quantity = product_quantity + " . $quantity . ", product_sold = product_sold-" . $quantity . " WHERE product_id='" . $id . "'");
             $this->db->query('COMMIT');
         }
     }
 }
示例#8
0
 public function __construct($id = null)
 {
     parent::__construct();
     $this->id = $id;
     if ($id == 'noload') {
         return $this;
     }
     /*
     			if(!empty($id)){
     				
     				$result = $this->db->simpleQuery()->from('last_ordered', array('id'))->where('user_id=?',$id)->order('date','desc')->all();
     			
     			}else {
     				
     				$result = $this->db->simpleQuery()->from('last_ordered', array('id'))->order('date','desc')->all();
     				
     			}
     		foreach ($result as $tab) {
     			
     			$this->order_m[] = new Order($tab['id']);
     			
     		}*/
 }
示例#9
0
 public function __construct($id = null)
 {
     parent::__construct();
     $this->id = $id;
 }
示例#10
0
 public function __construct()
 {
     parent::__construct();
 }
示例#11
0
 public function __construct($load = null)
 {
     parent::__construct();
 }
示例#12
0
文件: User.php 项目: bkb24/mvc
 public function __construct($data = null)
 {
     parent::__construct($data);
 }
示例#13
0
 public function __construct($search)
 {
     parent::__construct();
     $this->search = $search;
 }