Beispiel #1
0
 public static function getAllByPopular()
 {
     //		$sql = "select * from ".self::$tablename;
     $sql = "select *,count(*) as total from " . self::$tablename . " group by channel_id limit 10";
     $query = Executor::doit($sql);
     return Model::many($query[0], new FollowerData());
 }
Beispiel #2
0
 public static function getPublics()
 {
     $sql = "select * from " . self::$tablename . " where is_public=1";
     $query = Executor::doit($sql);
     return Model::many($query[0], new StatusData());
 }
Beispiel #3
0
 public static function getLike($q)
 {
     $sql = "select * from " . self::$tablename . " where name like '%{$q}%'";
     $query = Executor::doit($sql);
     return Model::many($query[0], new BlockData());
 }
Beispiel #4
0
 public static function getInputByProductIdCutIdYesF($product_id, $cut_id)
 {
     $sql = "select * from " . self::$tablename . " where product_id={$product_id} and cut_id={$cut_id} and operation_type_id=1 order by created_at desc";
     $query = Executor::doit($sql);
     return Model::many($query[0], new OperationData());
 }
Beispiel #5
0
 public static function getAllByUserId($user_id)
 {
     $sql = "select * from " . self::$tablename . " where user_id={$user_id} order by created_at desc";
     $query = Executor::doit($sql);
     return Model::many($query[0], new ProductData());
 }
Beispiel #6
0
 public static function getAllByUID($uid)
 {
     $sql = "select * from " . self::$tablename . " where user_id={$uid}";
     $query = Executor::doit($sql);
     return Model::many($query[0], new ChannelData());
 }
Beispiel #7
0
 public static function getLike($q)
 {
     $sql = "select * from " . self::$tablename . " inner join profile on (user.id=profile.user_id) where name like '%{$q}%' or lastname like '%{$q}%' ";
     $query = Executor::doit($sql);
     return Model::many($query[0], new UserData());
 }
 public static function getAllByUserId($user)
 {
     $sql = "select * from " . self::$tablename . " where user_id=" . $user;
     $query = Executor::doit($sql);
     return Model::many($query[0], new CommentData());
 }
Beispiel #9
0
 public static function getAllAppliedByPage($start_from, $limit)
 {
     $sql = "select * from " . self::$tablename . " where id<={$start_from} and is_applied=1 limit {$limit}";
     $query = Executor::doit($sql);
     return Model::many($query[0], new SellData());
 }
Beispiel #10
0
 public static function getAllByDay()
 {
     $sql = "select *,date(created_at) as created_date,count(*) as total from " . self::$tablename . " group by date(created_at) order by date(created_at) desc";
     $query = Executor::doit($sql);
     return Model::many($query[0], new ImageData());
 }
Beispiel #11
0
 public static function getLast5ByChannelId($channel_id)
 {
     $sql = "select * from " . self::$tablename . " where channel_id={$channel_id} order by created_at desc limit 5";
     $query = Executor::doit($sql);
     return Model::many($query[0], new NotificationData());
 }
Beispiel #12
0
 public static function getAll()
 {
     $sql = "select * from " . self::$tablename;
     $query = Executor::doit($sql);
     return Model::many($query[0], new UserData());
 }
Beispiel #13
0
 public static function getAllByDateBCOp($clientid, $start, $end, $op)
 {
     $sql = "select * from " . self::$tablename . " where date(created_at) >= \"{$start}\" and date(created_at) <= \"{$end}\" and client_id={$clientid}  and operation_type_id={$op} order by created_at desc";
     $query = Executor::doit($sql);
     return Model::many($query[0], new SellData());
 }
Beispiel #14
0
 public static function getAllbyImageId($image_id)
 {
     $sql = "select * from " . self::$tablename . " where image_id={$image_id}";
     $query = Executor::doit($sql);
     return Model::many($query[0], new ImageViewData());
 }
Beispiel #15
0
 public static function getAllByCategoryId($category_id)
 {
     $sql = "select * from " . self::$tablename . " where category_id={$category_id} order by created_at desc";
     $query = Executor::doit($sql);
     return Model::many($query[0], new FileData());
 }
Beispiel #16
0
 public static function getActives()
 {
     $sql = "select * from " . self::$tablename . " where is_active=1";
     $query = Executor::doit($sql);
     return Model::many($query[0], new PaymethodData());
 }