我找到了很多解决方案,但没有任何效果,因此再次发布这个问题。我有一张桌子,上面有水平滚动条。我尝试将表头设置为粘性,我可以使用它,poition:sticky但滚动停止工作。
有什么办法可以使用css来实现这两者吗?
这是一个简单的Fiddle供您参考。
更新 我需要它的行为与主页滚动相同,而不是在表格主体上添加滚动条。任何纯 JS 或角度解决方案也是可以接受的。当用户滚动页面而不是表格时,标题应该是粘性的。
public function actionUpdateprofile(){
$user = User::model()->findByPk($_POST['User']['user_id']);
$profile = Profile::model()->findByPk($_POST['User']['user_id']);
if(isset($_POST['User']) || isset($_POST['Profile'])){
$user->attributes = $_POST['User'];
$profile->attributes = $_POST['Profile'];
$user->save();
$profile->save();
}
}
Run Code Online (Sandbox Code Playgroud)
我做了这个代码来更新配置文件和用户表中的值.但它不起作用.如果我发送$_POST['Profile']['email'] = 'abc@gmail.com';
没有错误但数据库仍显示旧值.为什么?
我在那里做错了什么?
这是结果$profile->attributes.电子邮件仍然具有旧价值.
Array
(
[user_id] => 35
[lastname] => asd
[firstname] => asrtyr
[email] => xyz.gmail.com
[phoneno] => 123456
[prof_img] =>
[phoneno2] => 0
[agentKey] =>
[fb_id] =>
)
Run Code Online (Sandbox Code Playgroud) 我的问题是比较验证工作不正常.如果我min_bid_amount = 100和min_buy_amount=1000,它的工作.但是当min_bid_amount = 500和时出现问题min_buy_amount=1000.它还给了我错误信息.
这是我的模型规则
public function rules()
{
return [
[['min_bid_amount','min_buy_amount'], 'number'],
['min_buy_amount', 'compare','compareAttribute'=>'min_bid_amount','operator'=>'>',
'message'=>'Buying amount should be bigger than bid amount'],
[['auction_start_date', 'auction_end_date', 'created'], 'safe'],
[['id_product','min_bid_amount','min_buy_amount'], 'required']
];
}
Run Code Online (Sandbox Code Playgroud)
任何帮助将非常感谢.我认为JS不会将其转换为int类型值.那我该怎么办呢?
在标记为重复问题之前,请仔细阅读.我这里有不同的问题.我想使用yii2搜索模型生成这种查询.
select * from t1 innerjoin t2 on (t1.id = t2.id) where ((t1.price >= '1000' and t1.price <= '5000') OR
( t2.price >= '1000' and t2.price <= '5000' ))
Run Code Online (Sandbox Code Playgroud)
加入不是问题.主要问题是where子句.我尝试了这个,但没有工作.
$query->andFilterWhere([
'and',
['>=', 't1.price', $this>start_price],
['<=', 't1.price', $this->end_price]
])
->orFilterWhere([
'and',
['>=', 't2.price', $this->start_price],
['<=', 't2.price', $this->end_price]
]);
Run Code Online (Sandbox Code Playgroud) php ×3
javascript ×2
yii2 ×2
angular ×1
bootstrap-4 ×1
css ×1
html ×1
mysql ×1
yii ×1
yii2-model ×1