| 123456789101112131415161718192021222324252627282930 |
- <?php
- Doo::loadCore('db/DooModel');
- /**
- * Created by PhpStorm.
- * User: ellisran
- * Date: 2016/9/22
- * Time: 16:20
- */
- class Commonuser extends DooModel {
- public $id;
- public $username;
- public $password;
- public $_table = 'common_user';
- public $_primarykey = 'id';
- public $_fields = array('id', 'username', 'password');
- public function __construct() {
- parent::setupModel(__CLASS__);
- }
- public function getRowByUsername($data){
- return $this->getOne(array('where' => 'username=? and password=?', 'param' => array($data['name'],$data['password']), 'asArray' => TRUE));
- }
- public function getRowByuser($username){
- return $this->getOne(array('where' => 'username="'.$username.'"', 'asArray' => TRUE));
- }
- }
|