我有一个标准的Gii创建的管理视图,它使用CGridView,它显示我的用户表数据.
问题是名称为"root"的用户必须不可见.
有没有办法在条件"...和用户名!='root'"中添加静态?
admin.php [查看]
'columns'=>array(
'id',
'username',
'password',
'realname',
'email',
.....
Run Code Online (Sandbox Code Playgroud)
user.php [型号]
public function search()
{
// Warning: Please modify the following code to remove attributes that
// should not be searched.
$criteria=new CDbCriteria;
$criteria->compare('id',$this->id);
$criteria->compare('username',$this->username,true);
$criteria->compare('password',$this->password,true);
$criteria->compare('realname',$this->realname,true);
$criteria->compare('email',$this->email,true);
......
return new CActiveDataProvider($this, array(
'criteria'=>$criteria,
));
}
Run Code Online (Sandbox Code Playgroud) 我从一本关于Kivy和python的书中复制了这段代码
main.py
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.properties import ObjectProperty
from kivy.network.urlrequest import UrlRequest
import json
class AddLocationForm(BoxLayout):
search_input = ObjectProperty()
search_results = ObjectProperty()
def search_location(self) :
search_template = "http://api.openweathermap.org/data/2.5/find?q={}&type=like"
search_url = search_template.format(self.search_input.text)
request = UrlRequest(search_url, self.found_location)
def found_location(self, request, data) :
data = json.loads(data.decode())
cities = [ "{} ({})".format(d['name'], d['sys']['country']) for d in data['list'] ]
self.search_results.item_strings = cities
class WeatherApp(App):
pass
if __name__ == "__main__" :
WeatherApp().run()
Run Code Online (Sandbox Code Playgroud)
weather.kv
AddLocationForm:
<AddLocationForm>:
orientation: "vertical"
search_input: search_box
search_results: …Run Code Online (Sandbox Code Playgroud) 这是我的代码
import React from 'react';
import { Router, Route, IndexRoute, hashHistory } from 'react-router';
import Home from './components/Home';
import ArtistMain from './components/artists/ArtistMain';
const componentRoutes = {
component: Home,
path: "/",
indexRoute: { component: ArtistMain },
childRoutes: [
{
path: "artists/new",
getComponent(location, cb) {
System.import('./components/artists/ArtistCreate')
.then(module => cb(null, module.default));
}
},
{
path: "artists/:id",
getComponent(location, cb) {
System.import('./components/artists/ArtistDetail')
.then(module => cb(null, module.default));
}
},
{
path: "artists/:id/edit",
getComponent(location, cb) {
System.import('./components/artists/ArtistEdit')
.then(module => cb(null, module.default));
}
}
]
};
const Routes …Run Code Online (Sandbox Code Playgroud) 我按照这个问题的第二个答案禁用了全局选项ONLY_FULL_GROUP_BY。
mysql> SELECT @@sql_mode;
+-------------------------------------------------------------------------------------------------------------------------------------------+
| @@sql_mode |
+-------------------------------------------------------------------------------------------------------------------------------------------+
| ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |
+-------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0,00 sec)
mysql> SET sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));
Query OK, 0 rows affected (0,00 sec)
mysql> SELECT @@sql_mode;
+------------------------------------------------------------------------------------------------------------------------+
| @@sql_mode |
+------------------------------------------------------------------------------------------------------------------------+
| STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |
+------------------------------------------------------------------------------------------------------------------------+
1 row in set (0,00 sec)
Run Code Online (Sandbox Code Playgroud)
我刚刚发现,在重新启动mysql服务后,此选项将恢复。
这是我的环境
Server: Localhost via UNIX socket
MySQL 5.7.17-0ubuntu0.16.04.1
Ubuntu 16.04
Run Code Online (Sandbox Code Playgroud)
我以为它在配置文件之一中,但是我找不到它。您能指出我的位置或如何永久禁用它吗?
我希望能够在我的反应本机应用程序中“持续”监视设备连接。
我已经成功使用 redux-thunk 和 redux 了。
其实我可以做到这一点
import { NetInfo } from 'react-native';
import {
CONNECTION_CHECKING,
CONNECTION_AVAILABLE,
CONNECTION_UNAVAILABLE,
} from './types';
export const connectionChecking = () => {
return (dispatch) => {
dispatch ({
type: CONNECTION_CHECKING
});
NetInfo.getConnectionInfo()
.then((connectionInfo) => {
console.log('Connection info: ', connectionInfo);
switch (connectionInfo.type) {
case 'cellular':
dispatch ({
type: CONNECTION_AVAILABLE,
payload: connectionInfo.type
});
break;
case 'wifi':
dispatch ({
type: CONNECTION_AVAILABLE,
payload: connectionInfo.type
});
break;
default:
dispatch ({
type: CONNECTION_UNAVAILABLE,
});
}
})
.catch((error) => console.warn(error));
}; …Run Code Online (Sandbox Code Playgroud) 我正在使用eclipse来运行开发apk.
我可以从mnt/sdcard-删除apk创建的文件
但我无法删除创建文件夹.单击文件夹时,红色减号图标显示为灰色并禁用,但单击文件时,红色减号图标启用并显示红色.
那么,如何删除文件夹?我不能每次都破坏SD卡,我正在下载一个非常复杂的文件夹结构
当我删除'type'时我设置了isActive = 0;
每种"类型"都有很多"因果关系"
因此,当禁用某种类型时我想禁用每一个因果关系
在类型控制器中我正在尝试这个
$model = $this->loadModel($id);
$model->isActive = 0;
foreach ($model->causalsObj as $key => $causal ) {
$causal = CausalController::delete($causal->id);
}
$model->save();
Run Code Online (Sandbox Code Playgroud)
这不起作用(在ajax调用期间PHP错误)
我正在写一个不像我预期的那样工作的测试.
我需要使用一些抓取器,然后在测试运行时转储到屏幕上.
我怎么能这样做?如何回声,而不是用户如何抓取; 我可以使用抓取器,但我不知道如何在测试运行时回声.
我有一张大桌子。(> 50列,> 100行)。
我正在使用FixedHeader扩展程序来使第一行固定在广告顶部。这可行。
但是当用户水平滚动时,我无法使第一个COLUMN保持固定,我正在尝试使用FixedColumns做到这一点。
我实际的初始化代码是
$('#order_proposal_table').DataTable({
'pageLength' : 500,
'fixedHeader' : true,
'fixedColumns' : {
leftColumns: 1,
},
'sDom' : 'lprtip ', // default was lfrtip, i repeat pagination both on top and on bottom
'lengthMenu' : [[10,25,50,100,250,500,-1], [10,25,50,100,250,500,'Tutte']],
'language' : {
'url': '//cdn.datatables.net/plug-ins/1.10.10/i18n/Italian.json',
}
});
Run Code Online (Sandbox Code Playgroud)
该问题是,第一行保持固定在顶部,当用户垂直滚动,OK,但是当用户滚动浏览器窗口水平看所有其他列第一列不保持固定在页面的左边距。
我究竟做错了什么?
编辑1:
我尝试使用fixedColumns: true,,但没有任何改变。
编辑2:
我刚刚可以在javascript控制台中看到此信息:
DataTables warning: table id=order_proposal_table - FixedColumns is not
needed (no x-scrolling in …Run Code Online (Sandbox Code Playgroud) 我正在成功使用此代码
function refreshDataTable() {
// The table is made sortable
$('#order_proposal_table').DataTable({
'destroy' : true, // see http://datatables.net/manual/tech-notes/3#destroy - 2nd example
'paging' : false,
'scrollCollapse' : true,
'scrollY' : '65vh',
'fixedHeader' : true,
'dom' : 'rt',
});
}
Run Code Online (Sandbox Code Playgroud)
然后我试图在9列中的2列中启用搜索.
所以我改变了
'dom' : 'rt',
Run Code Online (Sandbox Code Playgroud)
成
'dom' : 'frt',
Run Code Online (Sandbox Code Playgroud)
显示查找输入框.这可行,但它搜索每一列,但我只需要搜索到2列.
因此,我正在尝试按照此官方指南有选择地禁用过滤,并添加columns定义
结果代码:
function refreshDataTable() {
// The table is made sortable
$('#order_proposal_table').DataTable({
'destroy' : true, // see http://datatables.net/manual/tech-notes/3#destroy - 2nd example
'paging' : false,
'scrollCollapse' : true, …Run Code Online (Sandbox Code Playgroud) javascript ×3
jquery ×2
php ×2
yii ×2
android ×1
codeception ×1
css ×1
datatable ×1
datatables ×1
eclipse ×1
explorer ×1
file ×1
kivy ×1
mysql ×1
python ×1
react-native ×1
react-router ×1
reactjs ×1
redux ×1
redux-thunk ×1
where ×1