当前位置: 首页>>代码示例>>PHP>>正文


PHP F::load_model方法代码示例

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


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

示例1: __construct

 public function __construct()
 {
     parent::__construct();
     $this->contactModel = F::load_model('contact');
     $this->userModel = F::load_model('user');
     $this->tagModel = F::load_model('tag');
 }
开发者ID:NASH-WORK,项目名称:NASH-CRM,代码行数:7,代码来源:contact_controller.php

示例2: __construct

 public function __construct()
 {
     parent::__construct();
     $this->syncModel = F::load_model('sync', array());
     #请求权限检查
     $this->params = $this->require_params(array('token'));
     if ($this->params['token'] != self::TOKEN) {
         throw new Exception('无效的授权信息', 100);
     }
 }
开发者ID:NASH-WORK,项目名称:NASH-CRM,代码行数:10,代码来源:sync_controller.php

示例3: countTask

 /**
  * 定时脚本,用于完成统计任务
  * 脚本每次执行只统计一组数据
  * @return void
  * @throws 100 If 无效的授权信息
  */
 public function countTask()
 {
     #参数检查
     $this->params = $this->require_params(array('token'));
     if ($this->params['token'] != self::COUNT_TASK_TOKEN) {
         throw new Exception('无效的授权信息', 100);
     }
     #获取待统计数据
     $this->statisticsModel = F::load_model('statistics', array());
     $countDataAll = $this->statisticsModel->getCountTaskData();
     if (empty($countDataAll)) {
         F::rest()->show_result();
     }
     foreach ($countDataAll as $countData) {
         #执行统计
         $this->returnData = $this->statisticsModel->count($countData);
         #通知脚本执行完毕
         $this->userModel = F::load_model('user', array());
         $this->userModel->sendCountTaskEmail($countData['email']);
     }
     F::rest()->show_result();
 }
开发者ID:NASH-WORK,项目名称:NASH-CRM,代码行数:28,代码来源:admin_controller.php

示例4: __construct

 public function __construct()
 {
     parent::__construct();
     $this->auditionModel = F::load_model('audition');
 }
开发者ID:NASH-WORK,项目名称:NASH-CRM,代码行数:5,代码来源:audition_controller.php

示例5: __construct

 /**
  * 构造函数
  * 
  * @access protected
  * @return void
  */
 protected function __construct()
 {
     $this->model = F::load_model('base');
     #设定时区信息
     date_default_timezone_set('Asia/Shanghai');
 }
开发者ID:NASH-WORK,项目名称:NASH-CRM,代码行数:12,代码来源:base_controller.php

示例6: createEventForContact

 /**
  * 给联系人生成一则事件
  *
  * @access public
  * @param string evnet
  * @param int id
  * @return void
  */
 public function createEventForContact()
 {
     $this->checkAccessToken();
     $this->params = $this->require_params(array('id', 'event'));
     $this->params['photo'] = F::request('photo', '');
     $this->params['systemEvent'] = F::request('systemEvent', 0);
     if ($this->params['photo']) {
         $this->params['event'] .= ' #图片 ';
     }
     $userId = $this->params['id'];
     $this->params['event'] = str_replace('#', '#', $this->params['event']);
     $this->params['event'] = str_replace('#r', '#R', $this->params['event']);
     $this->params['event'] = str_replace('@', '@', $this->params['event']);
     #书写对应事件
     preg_match_all('/#([^#^\\s^:]{1,})([\\s\\:\\,\\;]{0,1})/', $this->params['event'], $result);
     #针对来访,需要追加相应房间的事件
     $hadVisterTag = FALSE;
     $projectTag = '';
     $roomTagArray = array();
     foreach ($result[1] as $value) {
         $this->userModel->bindTag($userId, $value);
         if ($value == '来访') {
             $hadVisterTag = TRUE;
         }
         if (preg_match('/^R\\d{1,}/', $value)) {
             $roomTagArray[] = $value;
         }
         if ($this->isProjectTag($value)) {
             $projectTag = $value;
         }
     }
     if ($hadVisterTag && $projectTag) {
         #存在来访标签
         $this->groupModel = F::load_model('group', array());
         #获取当前操作联系人姓名
         $contactInfo = $this->userModel->get($this->params['id']);
         $contactName = $contactInfo[0]['nickname'];
         foreach ($roomTagArray as $roomTagArrayIndex) {
             $groupName = $projectTag . ' ' . str_replace('R', '', $roomTagArrayIndex);
             $groupId = $this->groupModel->getGroupIdByName($groupName);
             if ($groupId) {
                 #创建来访事件
                 $event = '#来访 ' . $contactName . '来访看房';
                 $this->groupModel->setGroupId($groupId)->createEvent($GLOBALS['userId'], $event);
             } else {
                 #todo 房间不存在
             }
         }
     }
     $eventContent = $this->params['event'];
     $eventType = $this->params['systemEvent'] ? self::SYSTEM_EVENT : self::USER_EVENT;
     $this->userModel->createEvent($GLOBALS['userId'], $userId, $eventContent, $this->params['photo'], $eventType);
     $this->userLog($GLOBALS['userId'], __CLASS__ . '/' . __FUNCTION__, serialize($this->params));
     F::rest()->show_result();
 }
开发者ID:NASH-WORK,项目名称:NASH-CRM,代码行数:63,代码来源:user_controller.php

示例7: __construct

 public function __construct()
 {
     $this->userModel = F::load_model('user');
 }
开发者ID:NASH-WORK,项目名称:NASH-CRM,代码行数:4,代码来源:audition_model.php

示例8: getUserProjectId

 private function getUserProjectId($userId)
 {
     $this->userModel = F::load_model('user', array());
     $allUserTag = $this->userModel->getUserTagList($userId);
     $retuanData = array();
     foreach ($allUserTag as $value) {
         if ($value['type'] == 2) {
             $retuanData[] = $value['tagId'];
         }
     }
     unset($allUserTag);
     return $retuanData;
 }
开发者ID:NASH-WORK,项目名称:NASH-CRM,代码行数:13,代码来源:group_model.php

示例9: getLikeEventUserList

 /**
  * 获取自己创建的事件列表
  *
  * @access public
  * @param int $userId 用户id
  * @param number $page 页数
  * @param number $num 每页信息数目
  * @return array
  */
 public function getLikeEventUserList($userId, $page, $num)
 {
     $likeEventList = F::db()->query('select distinct event_id from user_event where type = 1')->fetch_column_all('event_id');
     if (empty($likeEventList)) {
         return array();
     }
     $eventListTmp = F::db()->fetch_all('select event.id as eventId, user_id as userId, event.content as eventContent, create_time as createTime, create_user_id as createUserId, to_user_id as noticeUserId, photo, type
         from event left join notice on event.id = param where create_user_id = ? and event.status = 1 and event.id in (' . implode(',', $likeEventList) . ') order by event.id desc limit ?,?', array($userId, ($page - 1) * $num, $num));
     $eventList = array();
     foreach ($eventListTmp as $value) {
         if ($value['type'] == 3) {
             $groupModel = F::load_model('group', array('groupId' => $value['userId']));
             $groupInfo = $groupModel->setGroupId($value['userId'])->get();
             $ownInfo[0]['nickname'] = $groupInfo['name'];
             foreach ($groupInfo['tagList'] as $tagListIndex) {
                 $ownTagInfo[] = array('tagId' => $tagListIndex['id'], 'tagName' => $tagListIndex['name'], 'coler' => $tagListIndex['tagClass']);
             }
             $relation = $groupInfo['relation'];
         } else {
             $ownInfo = $this->_get($value['userId']);
             $ownTagInfo = $this->_getUserTagList($value['userId']);
             $relation = array();
         }
         $createUserInfo = $this->_get($value['createUserId']);
         $noticeUserInfo = $this->_get($value['noticeUserId']);
         $praiseList = $this->_getPraiseList($value['eventId']);
         $praiseListArray = array();
         foreach ($praiseList as $praiseListIndex) {
             $praiseUserInfo = $this->_get($praiseListIndex['userId']);
             $praiseListArray[] = $praiseUserInfo[0]['nickname'];
         }
         $eventList[] = array('createUserId' => $value['userId'], 'eventCreateUserNickname' => $ownInfo[0]['nickname'], 'photo' => $value['photo'], 'createUserPhoto' => $createUserInfo[0]['photo'], 'createUser' => $createUserInfo[0]['nickname'], 'eventContent' => $value['eventContent'], 'noticeUser' => $noticeUserInfo[0]['nickname'] ? '@' . $noticeUserInfo[0]['nickname'] : '', 'eventOwnInfo' => $ownTagInfo, 'createTime' => $this->_translateTime(strtotime($value['createTime'])), 'praiseList' => $praiseListArray, 'eventType' => $value['type'] == 3 ? 'group' : 'contact', 'relation' => $relation, 'enable_open' => $this->isEnableOpen($userId, $value['userId'], $value['type']));
     }
     #设置所有事件已读
     F::db()->execute('update event set unread_num = 0 where create_user_id = ? and status = 1', array($userId));
     return $eventList;
 }
开发者ID:NASH-WORK,项目名称:NASH-CRM,代码行数:46,代码来源:user_model.php

示例10: __construct

 public function __construct()
 {
     $this->tagModel = F::load_model('tag');
     $this->auditionModel = F::load_model('audition');
 }
开发者ID:NASH-WORK,项目名称:NASH-CRM,代码行数:5,代码来源:reportForm_model.php

示例11: __construct

 function __construct()
 {
     $this->userModel = F::load_model('user');
     $this->tagModel = F::load_model('tag');
 }
开发者ID:NASH-WORK,项目名称:NASH-CRM,代码行数:5,代码来源:contact_model.php

示例12: __construct

 /**
  * 构造函数
  *
  * @access public
  * @return void
  */
 public function __construct()
 {
     parent::__construct();
     $this->tagModel = F::load_model('tag');
 }
开发者ID:NASH-WORK,项目名称:NASH-CRM,代码行数:11,代码来源:tag_controller.php

示例13: __construct

 public function __construct()
 {
     parent::__construct();
     $this->reportModel = F::load_model('reportForm');
 }
开发者ID:NASH-WORK,项目名称:NASH-CRM,代码行数:5,代码来源:reportForm_controller.php

示例14: __construct

 public function __construct()
 {
     parent::__construct();
     $this->groupModel = F::load_model('group', array());
     $this->userModel = F::load_model('user', array());
 }
开发者ID:NASH-WORK,项目名称:NASH-CRM,代码行数:6,代码来源:group_controller.php

示例15: __construct

 public function __construct()
 {
     parent::__construct();
     $this->eventModel = F::load_model('event', array());
 }
开发者ID:NASH-WORK,项目名称:NASH-CRM,代码行数:5,代码来源:event_controller.php


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