Exemplo n.º 1
0
 /**
  * 初始化条件
  */
 protected function initWhere($condition)
 {
     if (!is_empty_null($condition['id'])) {
         $where['id'] = $condition['id'];
     }
     if (!empty($condition['asId'])) {
         $where['asId'] = $condition['asId'];
     }
     if (!empty($condition['apId'])) {
         $where['apId'] = $condition['apId'];
     }
     if (!empty($condition['adId'])) {
         $where['adId'] = $condition['adId'];
     }
     if (!is_empty_null($condition['adClass'])) {
         $where['adClass'] = $condition['adClass'];
     }
     if (!is_empty_null($condition['adType'])) {
         $where['adType'] = $condition['adType'];
     }
     if (!is_empty_null($condition['status'])) {
         $where['status'] = $condition['status'];
     }
     return $where;
 }
Exemplo n.º 2
0
 public function queryChannel($status = '', $mode = 0, $notId = 0)
 {
     if (!is_empty_null($status)) {
         $where['status'] = $status;
     }
     $list['rows'] = $this->where($where)->order('sort')->select();
     $list['rows'] = $this->eachData($list['rows'], 0, $mode, $notId);
     return $this->returnListData($list);
 }
Exemplo n.º 3
0
 /**
  * 重写像类initWhere
  * @see Common\Model.BaseModel::initWhere()
  */
 protected function initWhere($condition)
 {
     if (!is_empty_null($condition['id'])) {
         $where['id'] = $condition['id'];
     }
     if (!empty($condition['asKey'])) {
         $where['asKey'] = $condition['asKey'];
     }
     if (!is_empty_null($condition['asType'])) {
         $where['asType'] = $condition['asType'];
     }
     return $where;
 }
Exemplo n.º 4
0
 /**
  * 重写像类initWhere
  * @see Common\Model.BaseModel::initWhere()
  */
 protected function initWhere($condition)
 {
     if (!is_empty_null($condition['userId'])) {
         $where['userId'] = $condition['userId'];
     }
     if (!empty($condition['userToken'])) {
         $where['userToken'] = $condition['userToken'];
     }
     if (!empty($condition['userName'])) {
         $where['userName'] = $condition['userName'];
     }
     return $where;
 }
Exemplo n.º 5
0
 /**
  * 重写像类initWhere
  * @see Common\Model.BaseModel::initWhere()
  */
 protected function initWhere($condition)
 {
     if (!is_empty_null($condition['id'])) {
         $where['id'] = $condition['id'];
     }
     //资源商
     if (!empty($condition['rpId'])) {
         $where['rpId'] = $condition['rpId'];
     }
     //关键字标签
     if ($condition['keyList'][0] == 'notlike') {
         if (is_array($condition['keyList'][1])) {
             for ($i = 0; $i < count($condition['keyList'][1]); $i++) {
                 $where['_string'] .= ' (`keyList` not like "%' . $condition['keyList'][1][$i] . '%")  AND ( `title` not like "%' . $condition['keyList'][1][$i] . '%") AND';
             }
             $where['_string'] = substr($where['_string'], 0, strlen($where['_string']) - 3);
         } else {
             $where['_string'] = $condition['keyList'][1];
         }
     } else {
         if (is_array($condition['keyList'])) {
             for ($i = 0; $i < count($condition['keyList']); $i++) {
                 $where['_string'] .= ' (`keyList` like "%' . $condition['keyList'][$i] . '%")  OR ( `title` like "%' . $condition['keyList'][$i] . '%") OR';
             }
             $where['_string'] = substr($where['_string'], 0, strlen($where['_string']) - 2);
         } elseif (!empty($condition['keyList'])) {
             $where['_string'] = ' (`keyList` like "%' . $condition['keyList'] . '%")  OR ( `title` like "%' . $condition['keyList'] . '%") ';
         }
     }
     //阅读权限
     if (!is_empty_null($condition['playAuth'])) {
         $where['playAuth'] = $condition['playAuth'];
     }
     //标记
     if (!empty($condition['flags'])) {
         $where['_string'] = ($where['_string'] ? ' and ' : '') . " find_in_set('" . $condition['flags'] . "',flags)";
     }
     //状态
     if (!is_empty_null($condition['status'])) {
         $where['status'] = $condition['status'];
     }
     return $where;
 }
Exemplo n.º 6
0
 /**
  * 重写像类initWhere
  * @see Common\Model.BaseModel::initWhere()
  */
 protected function initWhere($condition)
 {
     if (!is_empty_null($condition['id'])) {
         $where['id'] = $condition['id'];
     }
     if (!is_empty_null($condition['actType'])) {
         $where['actType'] = $condition['actType'];
     }
     if (!empty($condition['classKey'])) {
         $where['classKey'] = $condition['classKey'];
     }
     if (!empty($condition['endTime'])) {
         $where['endTime'] = $condition['endTime'];
     }
     if (in_array($condition['status'], array('0', '1'))) {
         $where['status'] = $condition['status'];
     }
     return $where;
 }
Exemplo n.º 7
0
 /**
  * 重写像类initWhere
  * @see Common\Model.BaseModel::initWhere()
  */
 protected function initWhere($condition)
 {
     if (!is_empty_null($condition['id'])) {
         $where['id'] = $condition['id'];
     }
     //资源商
     if (!empty($condition['rpId'])) {
         $where['rpId'] = $condition['rpId'];
     }
     //题库权限
     if (!is_empty_null($condition['auth'])) {
         $where['auth'] = $condition['auth'];
     }
     //状态
     if (!is_empty_null($condition['status'])) {
         $where['status'] = $condition['status'];
     }
     return $where;
 }