• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Base_model类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Base_model的典型用法代码示例。如果您正苦于以下问题:PHP Base_model类的具体用法?PHP Base_model怎么用?PHP Base_model使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Base_model类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: get_articles

 /**
  * Get all the article_lang data + the page URL of the current language (page_url in the output array)
  *
  * @param	string	String to search
  * @return	array	Array of articles
  *
  */
 function get_articles($realm)
 {
     $realm = '\'%' . $realm . '%\'';
     $this->set_table('article');
     $this->set_lang_table('article_lang');
     $this->set_pk_name('id_article');
     $lang = Settings::get_lang();
     // Page_Article table
     $this->{$this->db_group}->select($this->parent_table . '.*', FALSE);
     $this->{$this->db_group}->join($this->parent_table, $this->parent_table . '.id_article = ' . $this->table . '.id_article', 'left');
     // Page table
     $this->{$this->db_group}->select('page.online');
     $this->{$this->db_group}->join($this->page_table, $this->page_table . '.id_page = ' . $this->parent_table . '.id_page', 'left');
     // Page lang table
     $this->{$this->db_group}->select('page_lang.lang');
     $this->{$this->db_group}->join($this->page_lang_table, $this->page_lang_table . '.id_page = ' . $this->page_table . '.id_page', 'left');
     // Menu table
     $this->{$this->db_group}->select('menu.id_menu, menu.name as menu_name');
     $this->{$this->db_group}->join($this->menu_table, $this->menu_table . '.id_menu = ' . $this->page_table . '.id_menu', 'left');
     // URL table : For Article's URL building
     $this->{$this->db_group}->select('url.path');
     $this->{$this->db_group}->join($this->url_table, $this->url_table . '.id_entity = ' . $this->table . '.id_article' . ' AND ' . $this->url_table . '.active=1 ' . ' AND ' . $this->url_table . '.lang = \'' . $lang . '\'', 'left');
     // Published filter
     $this->filter_on_published(self::$publish_filter, $lang);
     // Add the 'date' field to the query
     $this->{$this->db_group}->select('IF(article.logical_date !=0, article.logical_date, IF(article.publish_on !=0, article.publish_on, article.created )) AS date');
     // Search where
     $this->{$this->db_group}->where('(' . ' article_lang.title LIKE ' . $realm . ' OR article_lang.subtitle LIKE ' . $realm . ' OR article_lang.content LIKE ' . $realm . ')');
     $where = array("page.online" => 1, "article.indexed" => 1, "page_article.online" => 1, "page_article.main_parent" => 1, "article_lang.online" => 1, "article_lang.lang" => $lang, "page_lang.lang" => $lang);
     // Base_model->get_lang_list()
     $articles = parent::get_lang_list($where, $lang);
     return $articles;
 }
开发者ID:pompalini,项目名称:emngo,代码行数:40,代码来源:search_model.php


示例2: array

 function __construct()
 {
     parent::__construct();
     $table = 'omc_languages';
     $this->_TABLES = array(    'Langs' => 'omc_languages',
                         );
 }
开发者ID:hungnv0789,项目名称:vhtm,代码行数:7,代码来源:mlangs.php


示例3:

 function __construct()
 {
     parent::__construct();
     $this->load->library(array('contentfactory'));
     $this->config->load('position', true);
     $this->position = $this->config->item('position', 'position');
 }
开发者ID:asonweb,项目名称:mycicms,代码行数:7,代码来源:content_model.php


示例4: __construct

 /**
  * Class constructor
  *
  * @access public
  * @return void
  */
 public function __construct()
 {
     parent::__construct('user_bag');
     $this->config->load("props");
     $this->load->model('Points_model', 'points');
     $this->load->model('User_bag_order_model', 'user_bag_order');
 }
开发者ID:shuai959980629,项目名称:TTDV1,代码行数:13,代码来源:User_bag_model.php


示例5: __construct

 /**
  * Constructor
  *
  * @access	public
  */
 public function __construct()
 {
     parent::__construct();
     $this->table = 'users';
     $this->pk_name = 'id_user';
     $this->meta_table = 'users_meta';
 }
开发者ID:nbourguig,项目名称:ionize,代码行数:12,代码来源:users_model.php


示例6: __construct

 public function __construct()
 {
     parent::__construct('recharge_order');
     $this->load->model('User_model', 'usermodel');
     $this->load->model('User_info_model', 'User_info');
     $this->load->model('Borrow_model', 'borrow');
 }
开发者ID:shuai959980629,项目名称:TTDV1,代码行数:7,代码来源:Recharge_model.php


示例7: __construct

 public function __construct()
 {
     parent::__construct();
     $this->set_table('setting');
     $this->set_pk_name('id_setting');
     $this->load->helper('path_helper');
 }
开发者ID:BGCX261,项目名称:zillatek-project-svn-to-git,代码行数:7,代码来源:settings_model.php


示例8: __construct

 /**
  * Model Constructor
  *
  * @access	public
  */
 public function __construct()
 {
     parent::__construct();
     $this->set_table('page');
     $this->set_pk_name('id_page');
     $this->set_lang_table('page_lang');
 }
开发者ID:BGCX261,项目名称:zillatek-project-svn-to-git,代码行数:12,代码来源:sitemap_model.php


示例9: __construct

 public function __construct()
 {
     parent::__construct();
     $this->load->model('loan_model', 'loan');
     $this->load->model('task_flow_model', 'task_flow');
     $this->load->model('Loan_item_model', 'loan_item');
 }
开发者ID:shuai959980629,项目名称:shuai959980629.github.com,代码行数:7,代码来源:Pact_model.php


示例10: __construct

 /**
  * Model Constructor
  *
  * @access	public
  */
 public function __construct()
 {
     // Call the Model constructor
     parent::__construct();
     $this->table = 'menu';
     $this->pk_name = 'id_menu';
 }
开发者ID:pompalini,项目名称:emngo,代码行数:12,代码来源:menu_model.php


示例11: remove

 public function remove($id)
 {
     $this->load->model('Ad_model', 'ad');
     $this->ad->rm_by_position($id);
     $result = parent::remove($id);
     return $result;
 }
开发者ID:shuai959980629,项目名称:TTDV1,代码行数:7,代码来源:Ad_position_model.php


示例12: __construct

 /**
  * Constructor
  *
  * @access	public
  */
 public function __construct()
 {
     parent::__construct();
     $this->table = 'country';
     $this->pk_name = 'id_country';
     $this->lang_table = 'country_lang';
 }
开发者ID:pompalini,项目名称:emngo,代码行数:12,代码来源:country_model.php


示例13: replace

 function replace($id, $params)
 {
     if ($id) {
         unset($params['created_at']);
     }
     return parent::replace($id, $params);
 }
开发者ID:TF-Joynic,项目名称:tiandi,代码行数:7,代码来源:Usertask_model.php


示例14: __construct

 public function __construct()
 {
     parent::__construct();
     if (!isset($this->CI->product_model)) {
         $this->CI->load->model('product_model');
     }
 }
开发者ID:ohjack,项目名称:mallerp_standard,代码行数:7,代码来源:product_catalog_model.php


示例15: addPointsLog

 /**
  * @积分(图腾币)记录
  * @param uid int 用户uid
  * @param tob string 业务类型
  * @param scores int 积分(图腾币)点数
  * @param round int 第几轮签到记录
  * @param title string 名称
  * @return boolean(true/false)
  */
 public function addPointsLog($data)
 {
     $user = $this->user->get($data['uid']);
     $this->load->model('Dcredit_model', 'dcredit');
     $froum_credit = $this->dcredit->get_user_credit($user['mobile']);
     $round = empty($data['round']) ? 1 : $data['round'];
     $userinfo = $this->user_info->get($data['uid']);
     $all_point = $userinfo['points'] + $froum_credit;
     if (in_array($data['tob'], $this->tob_get, true)) {
         $points = $all_point + $data['scores'];
     } elseif (in_array($data['tob'], $this->tob_use, true)) {
         if ($userinfo['points'] < $data['scores']) {
             return false;
         }
         $points = $all_point - $data['scores'];
     }
     $pointlogs = array('uid' => $data['uid'], 'tob' => $data['tob'], 'scores' => $data['scores'], 'round' => $round, 'title' => $data['title'], 'after_points' => $points, 'created' => date('Y-m-d H:i:s', time()));
     $this->db->trans_begin();
     parent::create($pointlogs);
     $dta['points'] = $userinfo['points'] + $data['scores'];
     $this->user_info->save($dta, $userinfo['uid']);
     if ($this->db->trans_status() === false) {
         $this->db->trans_rollback();
         return false;
     } else {
         $this->db->trans_commit();
         return true;
     }
 }
开发者ID:shuai959980629,项目名称:TTDV1,代码行数:38,代码来源:Points_model.php


示例16: __construct

 public function __construct()
 {
     parent::__construct();
     $this->load->model('tag_model');
     $this->load->model('user_model');
     $this->table_name = 'problem_detail';
 }
开发者ID:TF-Joynic,项目名称:tiandi,代码行数:7,代码来源:Problem_detail_model.php


示例17: array

 function __construct()
 {
     parent::__construct();
     $this->_prefix = $this->config->item('backendpro_table_prefix');
     $this->_TABLES = array('Users' => $this->_prefix . 'users', 'UserProfiles' => $this->_prefix . 'user_profiles');
     log_message('debug', 'BackendPro : User_model class loaded');
 }
开发者ID:hungnv0789,项目名称:vhtm,代码行数:7,代码来源:user_model.php


示例18: __construct

 /**
  * Constructor
  *
  * @access	public
  */
 public function __construct()
 {
     parent::__construct();
     // Extend Fields definition tables
     $this->set_table('extend_field_type');
     $this->set_pk_name('id_extend_field_type');
 }
开发者ID:pompalini,项目名称:emngo,代码行数:12,代码来源:extend_field_type_model.php


示例19: __construct

 /**
  * Constructor
  *
  * @param	string  Path to the config file folder
  *
  */
 public function __construct()
 {
     // Ionize Core config file
     if (is_dir(realpath(APPPATH . 'config'))) {
         self::$path = realpath(APPPATH . 'config') . '/';
     }
     parent::__construct();
 }
开发者ID:pompalini,项目名称:emngo,代码行数:14,代码来源:config_model.php


示例20:

	function __construct()
	{
		parent::__construct();

		define("PREFERENCES", $this->config->item('backendpro_table_prefix') . 'preferences');

		log_message('debug','BackendPro : Preference_model class loaded');
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:8,代码来源:preference_model.php



注:本文中的Base_model类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Base_module_model类代码示例发布时间:2022-05-23
下一篇:
PHP Base_ThemeCommon类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap