Example #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());
 }
Example #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());
 }
Example #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());
 }
Example #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());
 }
Example #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());
 }
Example #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());
 }
Example #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());
 }
Example #8
0
 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());
 }
Example #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());
 }
Example #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());
 }
Example #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());
 }
Example #12
0
 public static function getAll()
 {
     $sql = "select * from " . self::$tablename;
     $query = Executor::doit($sql);
     return Model::many($query[0], new UserData());
 }
Example #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());
 }
Example #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());
 }
Example #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());
 }
Example #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());
 }