Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php namespace Models\Admin; /** * User Model * * @author sasou * @version 1.0 *..

Decoded Output download

<?php
namespace Models\Admin;

/**
 * User Model
 * 
 * @author  sasou
 * @version  1.0
 */
class User extends \Gene\Model
{

    /**
     * lists
     *
     * @param  array   $params   
     * @param  int     $start    
     * @param  int     $limit    
     * @return array
     */
    function lists($params, $start, $limit)
    {
        $count = $this->db
                      ->count("sys_user")
                      ->where($params)
                      ->cell();
        $list = $this->db
                     ->select("sys_user", "user_id,user_name,user_realname,user_icon,group_id,status")
                     ->where($params)
                     ->order("user_id desc")
                     ->limit($start, $limit)
                     ->all();

        return ["count" => $count, "list" => $list];
    }

    /**
     * row
     *
     * @param  int   $id  id
     * @return array
     */
    function row($id)
    {
        return $this->db
                    ->select("sys_user")
                    ->where("user_id=?", $id)
                    ->limit(1)
                    ->row();
    }

	/**
     * getField
     * 
     * @param int    $id 
     * @param string $field 
     * @return string
     */
    public function getField($id, $field ='user_name')
    {
        $data = $this->row($id);
        return isset($data[$field]) ? $data[$field] : '';
    }
    
    /**
     * add
     *
     * @param  array $data  
     * @return int id
     */
    function add($data)
    {
        return $this->db
                    ->insert("sys_user", $data)
                    ->lastId();
    }

    /**
     * edit
     *
     * @param  int   $id    id
     * @param  array $data  
     * @return int count
     */
    function edit($id, $data)
    {
        return $this->db
                    ->update("sys_user", $data)
                    ->where("user_id=?", $id)
                    ->affectedRows();
    }

    /**
     * status
     *
     * @param  int   $id  id
     * @return int count
     */
    function status($id)
    {
        return $this->db
                    ->sql("update sys_user set status=abs(status-1)")
                    ->where("user_id=?", $id)
                    ->affectedRows();
    }
    
    /**
     * del
     *
     * @param  int $id id
     * @return int count
     */
    function del($id)
    {
        return $this->db
                    ->delete("sys_user")
                    ->where("user_id=?", $id)
                    ->affectedRows();
    }

    /**
     * delAll
     *
     * @param  array $id_arr id
     * @return int   count
     */
    function delAll($id_arr)
    {
        return $this->db
                      ->delete("sys_user")
                      ->in("user_id in(?)", $id_arr)
                      ->affectedRows();
    }
    
    /**
     * countChird
     *
     * @param  mixed $id_arr idid
     * @return int   count
     */
    function countByGroupId($id_arr)
    {
        return $this->db
                       ->count("sys_user")
                       ->in("group_id in(?)", $id_arr)
                       ->cell();
    }
    
    /**
     * 
     * 
     * @param string $username 
     * @return array
     */
    function getUserInfoByName($username)
    {
        return $this->db->sql("select 
                                    a.user_id,a.user_name,a.user_pass,a.user_salt,a.user_realname,a.user_icon,
                                    a.group_id,b.group_title,a.status 
                                from 
                                    sys_user a 
                                left join 
                                    sys_group b on b.group_id=a.group_id 
                                where 
                                    a.user_name=?", $username)->row();
    }

}
 ?>

Did this file decode correctly?

Original Code

<?php
namespace Models\Admin;

/**
 * User Model
 * 
 * @author  sasou
 * @version  1.0
 */
class User extends \Gene\Model
{

    /**
     * lists
     *
     * @param  array   $params   
     * @param  int     $start    
     * @param  int     $limit    
     * @return array
     */
    function lists($params, $start, $limit)
    {
        $count = $this->db
                      ->count("sys_user")
                      ->where($params)
                      ->cell();
        $list = $this->db
                     ->select("sys_user", "user_id,user_name,user_realname,user_icon,group_id,status")
                     ->where($params)
                     ->order("user_id desc")
                     ->limit($start, $limit)
                     ->all();

        return ["count" => $count, "list" => $list];
    }

    /**
     * row
     *
     * @param  int   $id  id
     * @return array
     */
    function row($id)
    {
        return $this->db
                    ->select("sys_user")
                    ->where("user_id=?", $id)
                    ->limit(1)
                    ->row();
    }

	/**
     * getField
     * 
     * @param int    $id 
     * @param string $field 
     * @return string
     */
    public function getField($id, $field ='user_name')
    {
        $data = $this->row($id);
        return isset($data[$field]) ? $data[$field] : '';
    }
    
    /**
     * add
     *
     * @param  array $data  
     * @return int id
     */
    function add($data)
    {
        return $this->db
                    ->insert("sys_user", $data)
                    ->lastId();
    }

    /**
     * edit
     *
     * @param  int   $id    id
     * @param  array $data  
     * @return int count
     */
    function edit($id, $data)
    {
        return $this->db
                    ->update("sys_user", $data)
                    ->where("user_id=?", $id)
                    ->affectedRows();
    }

    /**
     * status
     *
     * @param  int   $id  id
     * @return int count
     */
    function status($id)
    {
        return $this->db
                    ->sql("update sys_user set status=abs(status-1)")
                    ->where("user_id=?", $id)
                    ->affectedRows();
    }
    
    /**
     * del
     *
     * @param  int $id id
     * @return int count
     */
    function del($id)
    {
        return $this->db
                    ->delete("sys_user")
                    ->where("user_id=?", $id)
                    ->affectedRows();
    }

    /**
     * delAll
     *
     * @param  array $id_arr id
     * @return int   count
     */
    function delAll($id_arr)
    {
        return $this->db
                      ->delete("sys_user")
                      ->in("user_id in(?)", $id_arr)
                      ->affectedRows();
    }
    
    /**
     * countChird
     *
     * @param  mixed $id_arr idid
     * @return int   count
     */
    function countByGroupId($id_arr)
    {
        return $this->db
                       ->count("sys_user")
                       ->in("group_id in(?)", $id_arr)
                       ->cell();
    }
    
    /**
     * 
     * 
     * @param string $username 
     * @return array
     */
    function getUserInfoByName($username)
    {
        return $this->db->sql("select 
                                    a.user_id,a.user_name,a.user_pass,a.user_salt,a.user_realname,a.user_icon,
                                    a.group_id,b.group_title,a.status 
                                from 
                                    sys_user a 
                                left join 
                                    sys_group b on b.group_id=a.group_id 
                                where 
                                    a.user_name=?", $username)->row();
    }

}

Function Calls

None

Variables

None

Stats

MD5 dfe1ad59a6d77d5ef5ae010ffebb6757
Eval Count 0
Decode Time 104 ms