Exemplo n.º 1
0
 function __construct()
 {
     parent::__construct();
     $table = 'omc_languages';
     $this->_TABLES = array(    'Langs' => 'omc_languages',
                         );
 }
Exemplo n.º 2
0
 function __construct()
 {
     parent::__construct();
     $this->load->library(array('contentfactory'));
     $this->config->load('position', true);
     $this->position = $this->config->item('position', 'position');
 }
Exemplo n.º 3
0
 /**
  * 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');
 }
Exemplo n.º 4
0
 /**
  * Constructor
  *
  * @access	public
  */
 public function __construct()
 {
     parent::__construct();
     $this->table = 'users';
     $this->pk_name = 'id_user';
     $this->meta_table = 'users_meta';
 }
Exemplo n.º 5
0
 /**
  * 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;
 }
Exemplo n.º 6
0
 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');
 }
 public function __construct()
 {
     parent::__construct();
     $this->set_table('setting');
     $this->set_pk_name('id_setting');
     $this->load->helper('path_helper');
 }
 /**
  * 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');
 }
 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');
 }
Exemplo n.º 10
0
 /**
  * Model Constructor
  *
  * @access	public
  */
 public function __construct()
 {
     // Call the Model constructor
     parent::__construct();
     $this->table = 'menu';
     $this->pk_name = 'id_menu';
 }
Exemplo n.º 11
0
 public function remove($id)
 {
     $this->load->model('Ad_model', 'ad');
     $this->ad->rm_by_position($id);
     $result = parent::remove($id);
     return $result;
 }
 public function __construct()
 {
     parent::__construct();
     $this->load->model('loan_item_model', 'loan_item');
     $this->load->model('employee_model', 'employee');
     $this->load->model('task_list_model', 'task_list');
 }
Exemplo n.º 13
0
 /**
  * Constructor
  *
  * @access	public
  */
 public function __construct()
 {
     parent::__construct();
     $this->table = 'country';
     $this->pk_name = 'id_country';
     $this->lang_table = 'country_lang';
 }
Exemplo n.º 14
0
 function replace($id, $params)
 {
     if ($id) {
         unset($params['created_at']);
     }
     return parent::replace($id, $params);
 }
 public function __construct()
 {
     parent::__construct();
     if (!isset($this->CI->product_model)) {
         $this->CI->load->model('product_model');
     }
 }
Exemplo n.º 16
0
 /**
  * @积分(图腾币)记录
  * @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;
     }
 }
Exemplo n.º 17
0
 public function __construct()
 {
     parent::__construct();
     $this->load->model('tag_model');
     $this->load->model('user_model');
     $this->table_name = 'problem_detail';
 }
Exemplo n.º 18
0
 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');
 }
Exemplo n.º 19
0
 /**
  * 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');
 }
Exemplo n.º 20
0
 /**
  * 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();
 }
Exemplo n.º 21
0
	function __construct()
	{
		parent::__construct();

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

		log_message('debug','BackendPro : Preference_model class loaded');
	}
 public function beforeValidate()
 {
     $r = parent::beforeValidate();
     if (!$this->id || !$this->name || !$this->order_num) {
         return false;
     }
     return $r;
 }
Exemplo n.º 23
0
 public function beforeValidate()
 {
     $r = parent::beforeValidate();
     if (!$this->data_filter_id || !$this->filter_id || !$this->icon || !$this->label || !$this->order_num) {
         return false;
     }
     return $r;
 }
Exemplo n.º 24
0
 /**
  * Deletes one Author
  * and the corresponding lang data
  *
  * @param int 	$id
  *
  * @return int	Number of delete items in main table
  *
  */
 public function delete($id)
 {
     $nb_rows = parent::delete($id, $this->_author_table);
     if ($nb_rows > 0) {
         parent::delete($id, $this->_author_lang_table);
     }
     return $nb_rows;
 }
Exemplo n.º 25
0
 function __construct()
 {
     parent::__construct();
     log_message('debug', 'Feed_model loaded.');
     $this->load->model('message_model');
     $this->load->model('ask_model');
     $this->load->model('user_model');
 }
Exemplo n.º 26
0
 /**
  * Constructor
  *
  * @access	public
  */
 public function __construct()
 {
     parent::__construct();
     $this->table = 'element_definition';
     $this->pk_name = 'id_element_definition';
     $this->lang_table = 'element_definition_lang';
     $this->element_table = 'element';
 }
Exemplo n.º 27
0
 public function find($cond = array(), $select = '', $return_dyadic_array = FALSE)
 {
     //{{{
     $this->_CI->load->model('User', 'user_m', TRUE);
     $this->_CI->load->model('Scheme', 'scheme_m', TRUE);
     $retweets = parent::find($cond, $select, TRUE);
     if (empty($retweets)) {
         return array();
     }
     //获取的 $retweets 就是按 retweet_id 的升序排列
     //只需要在遍历时 查询余下部分是否有包含相同 scheme_id 的
     //数据并清除之便可
     //@todo 为了节约时间 可以利用的优势就是 返回的集合不需要是有序的 ( 因为之后还会再按照时间排序 )
     foreach ($retweets as $i => $retweet) {
         //@todo 一切都是为了所谓的合并转发 此算法有改进的余地 起码不必每次都计算 sizeof
         if (sizeof($retweets) > 1) {
             //标志是否已经删除了某条记录
             $has_unset = FALSE;
             //取余下的数组
             array_walk(array_slice($retweets, $i), function ($value, $key) use(&$retweets, $retweet, $i, &$has_unset) {
                 if ($retweet['scheme_id'] === $value['scheme_id']) {
                     //有重复 删除当前的( 下标为$i ) 的记录
                     unset($retweets[$i]);
                     $has_unset = TRUE;
                 }
             });
             if ($has_unset === TRUE) {
                 continue;
             }
         }
         $prev_retweet_id = $retweet['prev_retweet_id'];
         if (is_numeric($prev_retweet_id) && $prev_retweet_id > 0) {
             //有效的 prev_retweet_id 意味着是 二转 或以上
             //此处如果调用本函数的话 会形成一个递归 获取完整的转发链
             //但是目前(只使用二转的情况)是没有必要的
             $prev_retweet = parent::find(array('retweet_id' => $prev_retweet_id));
             //此处的断言是 prev_retweet 信息是一定存咋的 若不存在 则需要触发一个异常
             if (empty($prev_retweet)) {
                 throw new Exception('通过有效的 prev_retweet_id 获取了一个空的 retweet.[prev_retweet_id=' . $prev_retweet_id . ']');
             }
             //获取相关用户信息
             $prev_retweet_user = $this->_CI->user_m->find(array('user_id' => $prev_retweet['retweeter_id']));
         } else {
             //无效的 prev_retweet_id 意味着是一转
             //"转发自"用户信息就是方案的所有用户
             $scheme = $this->_CI->scheme_m->find(array('scheme_id' => $retweet['scheme_id']));
             $prev_retweet_user = $scheme['holder'];
         }
         //获取当前 retweeter 用户的信息
         $retweets[$i]['retweeter'] = $this->_CI->user_m->find(array('user_id' => $retweet['retweeter_id']));
         $retweets[$i]['prev_retweet_user'] = $prev_retweet_user;
         $retweets[$i]['formated_time'] = $this->format_time($retweet['time']);
     }
     if ($return_dyadic_array == FALSE && sizeof($retweets) == 1) {
         return array_shift($retweets);
     }
     return $retweets;
 }
 public function __construct()
 {
     parent::__construct('loan_item');
     $this->load->model('loan_model', 'loan');
     $this->load->model('employee_model', 'employee');
     $this->load->model('task_list_model', 'task_list');
     $this->load->model('Evaluate_bill_model', 'Evaluate_bill');
     $this->load->model('wind_bill_model', 'wind_bill');
 }
Exemplo n.º 29
0
 /**
  * Constructor
  *
  * @access	public
  */
 public function __construct()
 {
     parent::__construct();
     $this->table = 'element';
     $this->pk_name = 'id_element';
     $this->definition_table = 'element_definition';
     $this->definition_pk_name = 'id_element_definition';
     $this->fields_table = 'extend_fields';
 }
 /**
  * 统计修改
  * @param  array   $data 修改字段信息
  * @param  integer $id   传入uid
  * @return bool        
  */
 public function save($data = array(), $id = 0)
 {
     $result = parent::save($data, $id);
     if (is_null($result)) {
         return false;
     } else {
         return true;
     }
 }