Example #1
0
 /**
  * add record
  *
  * @param App_Search_Dm $dm
  * @return multitype:|Ambigous <boolean, number, string, rowCount>
  */
 public function add(App_Search_Dm $dm)
 {
     if (true !== ($r = $dm->beforeAdd())) {
         return $r;
     }
     return $this->loadDao()->add($dm->getData());
 }
Example #2
0
 private function saveSearchInfomation($keyword, $type)
 {
     $userId = $this->loginUser->uid;
     $schoolId = $this->getCurrentSchoolId();
     if ($type == 'h') {
         $shop = $keyword;
         $type = $type;
     } else {
         $shop = $this->getInput("shop");
         $type = $this->getInput("type");
     }
     $dm = new App_Search_Dm();
     $dm->setUid($userId)->setSchoolid($schoolId)->setKeyword($shop)->setSearchType($type);
     $result = $this->_getSearchDs()->add($dm);
 }
Example #3
0
 private function _checkSearch()
 {
     $loginUser = Wekit::getLoginUser();
     $search_time_interval = $loginUser->getPermission('app_search_time_interval');
     $stampTime = Pw::getTime();
     if ($stampTime - $loginUser->info['last_search_time'] < $search_time_interval) {
         return new PwError('permission.search.limittime.allow', array('{limittime}' => $search_time_interval));
     }
     Wind::import('EXT:search.service.dm.App_Search_Dm');
     $dm = new App_Search_Dm($loginUser->uid);
     $dm->setLastSearchTime($stampTime);
     Wekit::load('user.PwUser')->editUser($dm, PwUser::FETCH_DATA);
     return true;
 }