Example #1
0
 /**
  * 静态方法, 单例统一访问入口
  * @return object  返回对象的唯一实例
  */
 public static function getInstance()
 {
     if (is_null(self::$_instance) || !isset(self::$_instance)) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
Example #2
0
 /**
  * 选择器名字的列表
  */
 public function getList()
 {
     $pageSize = MiniHttp::getParam('page_size', 10);
     $currentPage = MiniHttp::getParam('current_page', 1);
     $type = MiniHttp::getParam('type', 'web');
     $items = MiniChooser::getInstance()->getPageList($pageSize, $currentPage, $type);
     $total = MiniChooser::getInstance()->getTotal($type);
     $value['items'] = $items;
     $value['total'] = $total;
     return $value;
 }
Example #3
0
 /**
  * 根据Domain,app_key来获取结果
  */
 public function validKey($domain, $appKey)
 {
     $chooser = MiniChooser::getInstance()->getByKey($appKey);
     if (empty($chooser)) {
         return false;
     }
     $chooserId = $chooser['id'];
     $item = MiniChooserDomain::getInstance()->getByDomain($chooserId, $domain);
     if (empty($item)) {
         return false;
     }
     return true;
 }