Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $db = Zend_Db_Table::getDefaultAdapter();
- $select = $db->select();
- $select ->from(array('p' => 'sz_pet'), array('id', 'name', 'mana', 'blood', 'branch', 'damage', 'metal', 'wood', 'water', 'fire', 'earth', 'diff_level', 'base_grow_up' => 'armorial_power_base'))
- ->joinLeft(array('up' => 'sz_user_pets'),'p.id = up.pet_id',
- array('npk_win', 'lv' => 'level', 'lucky_point', 'total_damage' => new Zend_Db_Expr('level * p.damage')))
- ->joinLeft(array('upa' => 'sz_user_pet_armorial'), 'p.id = upa.pet_id AND up.user_id = upa.user_id AND p.armorial=1 ', array('level_mega' => 'armorial'))
- ->where('up.user_id = ?', $this->getGid())
- ->where('up.stat = ?', 1)
- ->order('total_damage DESC');
Advertisement
Add Comment
Please, Sign In to add comment