小编Bal*_*ath的帖子

MySQL - 按category_id排序尽量避免重复彼此接近

请忍受我的英语.

我有一张这样的桌子,

 id |  category_id  |  product_id
 -----------------------------------
  1 |  1            |  1
  2 |  1            |  2
  3 |  2            |  1
  4 |  2            |  3
  5 |  1            |  4
  6 |  3            |  5
Run Code Online (Sandbox Code Playgroud)

我想要输出,

id  |  category_id  |  product_id
----------------------------------
1   |  1            |  1
3   |  2            |  1
6   |  3            |  5
2   |  1            |  2
4   |  2            |  3
5   |  1            |  4
Run Code Online (Sandbox Code Playgroud)

所以简而言之,我需要的是,category_id必须按顺序排列,以便像1, 2, …

mysql sql-order-by

21
推荐指数
2
解决办法
407
查看次数

在静态解析符号值时遇到错误.调用函数'InputSelected',不支持函数调用

我有一个基于角度2构建的遗留代码.这是我在名为users.input.ts的文件上的代码.它编译成功.但是当我尝试构建时,我得到了编译错误.谁能帮助我做我必须做的事情?

输入select.ts

import { Component, Input, Output, EventEmitter, OnChanges, SimpleChange } from '@angular/core';
import { InputSelectSearchComponent } from '../input-select-search/input-select-search.component';
import { InputBase } from '../../classes/input-base';
import { UIStylekitService } from '../../ui-stylekit.service';

export class InputSelect extends InputBase<string> {
  controlType = 'select';
  options: {value: string, label: string}[] = [];

  constructor(options: {} = {}) {
    super(options);
    this.options = options['options'] || [];
  }
}

@Component({
  selector: 'input-select',
  templateUrl: 'input-select.component.html',
  inputs: ['form','input']
})
export class InputSelectComponent extends InputSelectSearchComponent {

  constructor(
    private __Stylekit: UIStylekitService ) { …
Run Code Online (Sandbox Code Playgroud)

build-error angular-cli angular

5
推荐指数
0
解决办法
104
查看次数

如何将jQuery UI添加到Asset Bundle

我有以下资产包,我想添加jQuery UI作为其一部分.我该怎么做?

<?php
namespace app\assets;

use yii\web\AssetBundle;

class AdminAsset extends AssetBundle
{
    public $basePath = '@webroot/assets-admin';
    public $baseUrl = '@web/assets-admin';

    public $css = [
        'css/common.css',
        'css/animations.css',
        'css/editor.css',
        'css/form.css',
        'css/fileupload.css',
        'css/template.css',
        'css/icons.css',
    ];
    public $js = [
        'js/libs/modernizr.js',
        'js/script.js'
    ];
    public $depends = [
        'yii\web\JqueryAsset',
        'yii\web\YiiAsset',
    ];
} 
Run Code Online (Sandbox Code Playgroud)

php jquery-ui yii2 assetbundle

4
推荐指数
1
解决办法
1万
查看次数

为什么嵌套的 nth-of-type 选择器不起作用?

我需要的是,第一次出现的类“.has-error”内的文本框以红色突出显示。我试图嵌套 :nth-of-type 选择器,如下所示。它仅在 id 为“name”的 div 具有“has-error”类时才有效。但我在其他场景中不起作用。有人可以解释一下它不起作用的原因吗?

.fields input[type="text"] {
	color: #000;
	border: 1px solid #000;
}
.fields > .error:nth-of-type(1) > .has-error:nth-of-type(1) input[type="text"] {
	color: #f00;
	border-color: #f00;
}
Run Code Online (Sandbox Code Playgroud)
<div class="fields">
	<div class="col error">
		<div id="name" class="input">
			<input type="text" name="name" />
		</div>
		<div id="email" class="input has-error">
			<input type="text" name="email" />
		</div>
	</div>
	<div class="col error">
		<div id="age" class="input has-error">
			<input type="text" name="age" />
		</div>
		<div id="phone" class="input has-error">
			<input type="text" name="phone" />
		</div>
	</div>
</div>
Run Code Online (Sandbox Code Playgroud)

css css-selectors

2
推荐指数
1
解决办法
387
查看次数