请忍受我的英语.
我有一张这样的桌子,
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, …
我有一个基于角度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) 我有以下资产包,我想添加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) 我需要的是,第一次出现的类“.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)
angular ×1
angular-cli ×1
assetbundle ×1
build-error ×1
css ×1
jquery-ui ×1
mysql ×1
php ×1
sql-order-by ×1
yii2 ×1