本文整理汇总了PHP中CModel::make方法的典型用法代码示例。如果您正苦于以下问题:PHP CModel::make方法的具体用法?PHP CModel::make怎么用?PHP CModel::make使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CModel
的用法示例。
在下文中一共展示了CModel::make方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: login
/**
* 管理员登录
*/
protected function login()
{
$username = $this->input->post('username', true);
$password = $this->input->post('password', true);
$this->_user->username = trim($username);
$this->_user->password = $password;
$modLogin = CModel::make('admin/loginman_model', 'loginman_model');
$boolean = $modLogin->authenticate($this->_user);
return $boolean === true && $modLogin->save();
}
示例2: _authentication
/**
* 用户身份验证
*/
public function _authentication()
{
if ($this->_user->isGuest) {
$modelLogin = CModel::make('login_model');
$return = $modelLogin->authLogin($this->_user);
//申请授权并登录
if ($return !== true) {
CAjax::result($return);
exit(0);
}
}
}
示例3: matchOrigin
static function matchOrigin($value)
{
static $rows = array();
if (!$rows) {
$modelGoods = CModel::make('goods_model');
$rows = $modelGoods->getOrigin();
}
if ($rows) {
foreach ($rows as $row) {
if ($row['value'] == $value) {
return $row['name'];
}
}
}
return '';
}
示例4: append
/**
* 新增故事
*/
public function append($openId, $data)
{
$return = false;
$modelReg = CModel::make('register_model');
$regRow = $modelReg->getRowByWId($openId);
if ($regRow) {
$content = $data['content'];
$now = time();
$value = array('register_id' => $regRow->id, 'wxid' => $openId, 'digest' => mb_substr($content, 32), 'create_time' => $now, 'update_time' => $now);
$return = $this->db->insert('mhr_story', $value);
if ($return == true) {
$value = array('story_id' => $this->db->insert_id(), 'content' => $content, 'update_time' => $now);
$return = $this->db->insert('mhr_story_content', $value);
}
}
return $return;
}
示例5: __construct
public function __construct()
{
parent::__construct();
$this->_modelSys = CModel::make('admin/sysman_model', 'sysman_model');
$this->_route = $this->input->get('r', true);
}
示例6: __construct
public function __construct()
{
parent::__construct();
$this->_modelOrder = CModel::make('admin/orderman_model', 'orderMan_model');
}
示例7: __construct
public function __construct()
{
parent::__construct();
$this->_modelRegister = CModel::make('admin/registerman_model', 'registerman_model');
}
示例8: __construct
public function __construct()
{
parent::__construct();
$this->_modelstory = CModel::make('admin/storyman_model', 'storyman_model');
}
示例9: __construct
public function __construct()
{
parent::__construct();
$this->_modelPay = CModel::make('admin/payman_model', 'payMan_model');
}
示例10: setPassword
/**
* 设置管理员密码
*/
public function setPassword($id, $password)
{
if (strlen($password) <= 0) {
return false;
}
$id = (int) $id;
$sql = "select id from mic_user where isdel=0 and id=?";
$query = $this->db->query($sql, array($id));
if (!$query->row()) {
return false;
}
$model = CModel::make('login_model');
$password = $model->hashPassword($password);
$sql = "update mic_user set password=? where isdel=0 and id={$id}";
$return = $this->db->query($sql, array($password));
return $return;
}
示例11: __construct
public function __construct()
{
parent::__construct();
$this->_modelItem = CModel::make('admin/itemman_model', 'itemman_model');
}