예제 #1
0
파일: UserLog.php 프로젝트: name3/cheng
 public static function history()
 {
     return safe_array_map(function ($info) {
         $info['user'] = new User($info['user']);
         return $info;
     }, Pdb::fetchAll('*', self::$table));
 }
예제 #2
0
파일: Product.php 프로젝트: name3/cheng
 public static function read($conds = array())
 {
     list($tables, $conds, $order, $tail) = self::buildDbArg($conds);
     return safe_array_map(function ($info) {
         return new Product($info);
     }, Pdb::fetchAll('*', $tables, $conds, $order, $tail));
 }
예제 #3
0
파일: Admin.php 프로젝트: name3/cheng
 public function listFactory($conds = array())
 {
     extract(self::defaultConds($conds));
     $tail = "LIMIT {$limit} OFFSET {$offset}";
     return safe_array_map(function ($id) {
         return new Factory($id);
     }, Pdb::fetchAll('id', Factory::$table, null, null, $tail));
 }
예제 #4
0
파일: SuperAdmin.php 프로젝트: name3/cheng
 public function listAdmin($conds = array())
 {
     extract(self::defaultConds($conds));
     $conds = array('type=?' => 'Admin');
     $tail = "LIMIT {$limit} OFFSET {$offset}";
     return safe_array_map(function ($info) {
         return new Admin($info);
     }, Pdb::fetchAll('*', User::$table, $conds, array(), $tail));
 }
예제 #5
0
파일: Cart.php 프로젝트: name3/cheng
 public function orders()
 {
     if ($this->orders != null) {
         return $this->orders;
     }
     $ids = Pdb::fetchAll('small_order', self::$table);
     return $this->orders = safe_array_map(function ($id) {
         return new Order($id);
     }, $ids);
     // no paging here
 }
예제 #6
0
파일: Account.php 프로젝트: name3/cheng
 public function history($conds = array())
 {
     extract($conds);
     $tail = "LIMIT {$limit} OFFSET {$offset}";
     extract($this->buildHistoryArg($conds));
     if (!isset($sort) || empty($sort)) {
         $sort = 'DESC';
     }
     $order = array("time {$sort}");
     $ids = Pdb::fetchAll('id', AccountHistory::$table, $conds, $order);
     return safe_array_map(function ($id) {
         return new AccountHistory($id);
     }, $ids);
 }
예제 #7
0
파일: Customer.php 프로젝트: name3/cheng
 public function listOrders($conds)
 {
     extract(slef::defaultConds($conds));
     $tail = "LIMIT {$limit} OFFSET {$offset}";
     return safe_array_map(function ($info) {
         $pb = new productCombine($info['products']);
         $info['products'] = $pb->products();
         $info['customer'] = new Customer($info['customer']);
         $info['factory'] = new Factory($info['factory']);
     }, Pdb::fetchALL('*', Order::$table, $tail));
 }
예제 #8
0
파일: User.php 프로젝트: name3/cheng
 public function loginHistory($conds = array())
 {
     extract(self::defaultConds($conds));
     $conds = $this->loginConds();
     $order = 'id desc';
     $tail = "LIMIT {$limit} OFFSET {$offset}";
     $ret = safe_array_map(function ($info) {
         $info['ip'] = $info['info'];
         return $info;
     }, Pdb::fetchAll('*', UserLog::$table, $conds, $order, $tail));
     return $ret;
 }
예제 #9
0
파일: Order.php 프로젝트: name3/cheng
 public static function listOrder($conds)
 {
     extract(self::defaultConds($conds));
     $tail = "LIMIT {$limit} OFFSET {$offset}";
     extract(self::buildDbArgs($conds));
     $order = array('submit_time DESC');
     return safe_array_map(function ($id) {
         return new Order($id);
     }, Pdb::fetchAll('o.id', $tables, $conds, $order, $tail));
 }