小编Sun*_*S.M的帖子

显示:Chrome中的表格单元格问题,而在其他浏览器中正常工作

我使用表格标签开发html代码,并且它在所有其他浏览器(如safari,Firefox,IE等)中工作正常,但代码不适用于chrome作为结果输出,如下面的附加图像所示.

.contfull {
  max-height: 900px;
}
body {
  background: #cbd0d4 none repeat scroll 0 0;
  color: #444444;
  font-size: 14px;
  margin: 0;
  min-width: 100% !important;
  padding: 0;
}
.content {
  margin: 0 auto;
  width: 100%;
}
.container_q {
  background: #f0efef none repeat scroll 0 0;
  float: left;
  height: 100%;
  width: 100%;
}
.header_q {
  background: #ffffff none repeat scroll 0 0;
  box-shadow: 0 2px 2px #e0dcdc;
  display: block;
  padding: 10px 20px 4px;
  position: relative;
  z-index: 100;
}
.logo_q {
  display: inline-block; …
Run Code Online (Sandbox Code Playgroud)

html css

11
推荐指数
1
解决办法
1020
查看次数

Sequelize ORM 在选择中添加主键列,虽然我排除了它

我已经通过sequelize准备了一个查询,它通过关联hasOne、聚合函数SUM()和Group By子句获取记录,但是sequelize查询自动添加了目标表主键列,并且该列导致group by子句错误。

这是我的节点函数,它从服务获取数据。

exports.getCustomerByManagerId = async (userId, limit, offset) => {
  const customers = await models.Customer.findAndCountAll({
    where: { account_manager_id: userId },
    include: [
      { model: models.UserProfile, as: 'accountmanager', attributes: userProfileSanitizer.sanitizeuserProfile() },
      {
        model: models.Task,
        as: 'customertask',
        attributes: [
          [sequelize.literal('SUM(IF(customertask.status = 1, 1, 0))'), 'todo'],
          [sequelize.literal('SUM(IF(customertask.status = 2, 1, 0))'), 'pendingTask'],
          [sequelize.literal('SUM(IF(customertask.status = 3, 1, 0))'), 'completeTask'],
          [sequelize.literal('COUNT(customertask.id)'), 'totalTask']
        ]
      }
    ],
    group: ['`customer`.`customer_id`'],
    order: [
      ['createdAt', 'DESC']
    ],
    limit,
    offset
  });
Run Code Online (Sandbox Code Playgroud)

并执行续集查询生成结果查询 AS :

SELECT `customer`.`customer_id`, `customer`.`userId`, `customer`.`name`, `customer`.`account_manager_id`, …
Run Code Online (Sandbox Code Playgroud)

mysql node.js sequelize.js

5
推荐指数
2
解决办法
1778
查看次数

标签 统计

css ×1

html ×1

mysql ×1

node.js ×1

sequelize.js ×1