zoukankan      html  css  js  c++  java
  • ThinkPHP5杂技(二)

    不要使用数据库查询嵌套

            if (!$listA = Db::name('coin')
                ->field('id,symbol')
                ->where('id', 'IN', logic('Alliance/Alliance')->getSet($this->site['id'], 'coin'))
                ->order('id asc')
                ->select()) {
                $this->error('没有可用币种');
            }

    logic Alliance中包含数据查询,导致内部采用了field('id, symbol')条件

    TP5分页默认是get方式做跳转

    想要实现ajax样式,通过事先绑定click事件,然后移除href属性。

    $(document).ready(function () {
      $(".pagination > li > a").each(function () {
        $(this).click(function () {
          var href = $(this).attr('href');
          $(this).removeAttr('href');
          $.ajax({
            type: "GET",
            url: href,
            dataType: "html",
            success: function (data) {
              $(".inbox-body").html(data);
            }
          })
        });
      });
  • 相关阅读:
    第二次结对编程作业
    团队项目-需求分析报告
    团队项目-选题报告
    第一次结对编程作业
    第一次编程作业
    第一次博客作业
    computed vs methods
    v-for
    jQuery事件绑定on()、bind()与delegate() 方法详解
    开题
  • 原文地址:https://www.cnblogs.com/8000cabbage/p/7895092.html
Copyright © 2011-2022 走看看