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()); }
public static function getPublics() { $sql = "select * from " . self::$tablename . " where is_public=1"; $query = Executor::doit($sql); return Model::many($query[0], new StatusData()); }
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()); }
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()); }
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()); }
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()); }
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()); }
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()); }
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()); }
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()); }
public static function getAll() { $sql = "select * from " . self::$tablename; $query = Executor::doit($sql); return Model::many($query[0], new UserData()); }
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()); }
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()); }
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()); }
public static function getActives() { $sql = "select * from " . self::$tablename . " where is_active=1"; $query = Executor::doit($sql); return Model::many($query[0], new PaymethodData()); }