本文整理匯總了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');
}