想给depositor模块增加搜索功能,无法实现,请指教!

qq_54f42ac924730 2015-04-16 16:04:19

按照trade模块依葫芦画瓢,点搜索没有反应,在depositor模块config里面加了


       
      $config
      ->
      depositor
      ->
      search
      [
      'module'
      ] = 
      'depositor'
      ; 
       
      $config
      ->
      depositor
      ->
      search
      [
      'fields'
      ][
      'abbr'
      ] = 
      $lang
      ->
      depositor
      ->
      abbr
      ; 
      //$
       
      $config
      ->
      depositor
      ->
      search
      [
      'fields'
      ][
      'date'
      ]      = 
      $lang
      ->
      depositor
      ->
      date
      ; 
      $config
      ->
      depositor
      ->
      search
      [
      'fields'
      ][
      'id'
      ]        = 
      $lang
      ->
      depositor
      ->
      id
      ; 
       
       
       
      $config
      ->
      depositor
      ->
      search
      [
      'params'
      ][
      'abbr'
      ]    = 
      array
      (
      'operator' 
      => 
      'include'
      , 
      'control' 
      => 
      'input'
      , 
      'values' 
      => 
      ''
      ); 
       
      $config
      ->
      depositor
      ->
      search
      [
      'params'
      ][
      'date'
      ]      = 
      array
      (
      'operator' 
      => 
      '>='
      , 
      'control' 
      => 
      'input'
      , 
      'values' 
      => 
      ''
      , 
      'class' 
      => 
      'date'
      ); 
      $config
      ->
      depositor
      ->
      search
      [
      'params'
      ][
      'id'
      ]        = 
      array
      (
      'operator' 
      => 
      '='
      , 
      'control' 
      => 
      'input'
      , 
      'values' 
      => 
      ''
      ); 

mode


      public function 
      getList(
      $mode
      , 
      $orderBy 
      = 
      'id_desc'
      , 
      $pager 
      = 
      null
      ) 
      { 
       
      if
      (
      $this
      ->
      session
      ->
      tradeQuery 
      === 
      false
      ) 
      $this
      ->
      session
      ->set(
      'tradeQuery'
      , 
      ' 1 = 1'
      ); 
       
      $tradeQuery 
      = 
      $this
      ->loadModel(
      'search'
      , 
      'sys'
      )->replaceDynamic(
      $this
      ->
      session
      ->
      tradeQuery
      ); 
       
      return 
      $this
      ->
      dao
      ->select(
      '*'
      )->from(
      TABLE_DEPOSITOR
      ) ->beginIF(
      $mode 
      == 
      'bysearch'
      )->andWhere(
      $tradeQuery
      )->fi() 
       ->orderBy(
      $orderBy
      )->page(
      $pager
      )->fetchAll(
      'id'
      ); 
      }
browse.html


      <?php include 
      '../../common/view/header.html.php'
      ;
      ?>
       
      <?php 
      js::
      set
      (
      'mode'
      , 
      $mode
      );
      ?>
       
      <?php 
      $vars 
      = 
      "mode=
      {
      $mode
      }
      &orderBy=%s&recTotal=
      {
      $pager
      ->
      recTotal
      }
      &recPerPage=
      {
      $pager
      ->
      recPerPage
      }
      &pageID=
      {
      $pager
      ->
      pageID
      }
      "
      ;
      ?>
       
      <
      li 
      id=
      'bysearchTab'
      >
      <?php echo 
      html::
      a
      (
      '#'
      , 
      "<i class='icon-search icon'></i>" 
      . 
      $lang
      ->
      search
      ->
      common
      )
      ?>
      </
      li
      >

control


      public function 
      browse(
      $mode 
      = 
      'all'
      ,
      $orderBy 
      = 
      'id_desc'
      , 
      $recTotal 
      = 
      0
      , 
      $recPerPage 
      = 
      20
      , 
      $pageID 
      = 
      1
      ) 
      { 
       
      $this
      ->
      app
      ->loadClass(
      'pager'
      , 
      $static 
      = 
      true
      ); 
       
      $pager 
      = 
      new 
      pager(
      $recTotal
      , 
      $recPerPage
      , 
      $pageID
      ); 
       
       
      $this
      ->loadModel(
      'search'
      , 
      'sys'
      ); 
       
      $this
      ->
      config
      ->
      depositor
      ->
      search
      [
      'actionURL'
      ] = 
      $this
      ->createlink(
      'depositor'
      , 
      'browse'
      , 
      'mode=bysearch'
      ); 
       
      $this
      ->
      config
      ->
      depositor
      ->
      search
      [
      'params'
      ][
      'abbr'
      ][
      'values'
      ] = 
      array
      (
      '' 
      => 
      ''
      ) + 
      $this
      ->
      depositor
      ->getPairs(); 
       
       
      $this
      ->
      config
      ->
      depositor
      ->
      search
      [
      'params'
      ][
      'id'
      ][
      'values'
      ]  = 
      array
      (
      '' 
      => 
      ''
      ) ; 
       
      $this
      ->
      search
      ->setSearchParams(
      $this
      ->
      config
      ->
      depositor
      ->
      search
      );


回帖列表
wwccss 2015-04-19 18:32:11
你可以购买我们的技术支持服务。
qq_54f42ac924730 2015-04-19 18:00:56
不是要调试代码,我换个方式问问,如何给browse view增加搜索功能
wwccss 2015-04-19 16:22:04
代码自己要学会调试,查找错误日志。我们没有资源帮大家调试代码。请理解。
1/ 1
鲁ICP备18054969号
ZSITE8.6