我有这个下面的代码所有三个DIV有相同的类名我想要做的是通过使用jquery索引号访问/检索第二个DIV值第二个DIV的值是3.21,我试图使用此代码检索div.OddVal.index(2)没有运气任何想法的人我错了吗?
<div class="ThreeWayCol OddsCol1">
<div class="OddVal ng-pristine ng-untouched ng-valid ng-binding ng-scope ng-not-empty" ng-repeat="sel in event._matchMarket.selections" ng-model="sel" ng-class="{'Sel': oddSelections[event.id].sels[sel.id]}" ng-click="selectOdd(event,event._matchMarket,sel)">3.37</div>
<div class="OddVal ng-pristine ng-untouched ng-valid ng-binding ng-scope ng-not-empty" ng-repeat="sel in event._matchMarket.selections" ng-model="sel" ng-class="{'Sel': oddSelections[event.id].sels[sel.id]}" ng-click="selectOdd(event,event._matchMarket,sel)">3.21</div>
<div class="OddVal ng-pristine ng-untouched ng-valid ng-binding ng-scope ng-not-empty" ng-repeat="sel in event._matchMarket.selections" ng-model="sel" ng-class="{'Sel': oddSelections[event.id].sels[sel.id]}" ng-click="selectOdd(event,event._matchMarket,sel)">2.07</div>
</div>
Run Code Online (Sandbox Code Playgroud) 我正在尝试从表中使用字段groupBy获取数据。我正在使用这个查询typetransaction
DB::table($this->table)
->select()
->whereRaw($where['rawQuery'], isset($where['bindParams']) ? $where['bindParams'] : array())
->groupBy('type')
->get();
Run Code Online (Sandbox Code Playgroud)
但它并没有给出complete records. 我的表中有10多条记录。但它只给了我两个。一个用于 type=1,另一个用于 type=2。它仅从每种类型中选择记录。我期待我能得到所有transactions基于condition分组的内容two result set。有人知道为什么会这样吗?
我有一个简单的 textarea 标签,如下所示:
<div class="form-group{{ $errors->has('main') ? ' has-error' : '' }}">
<label id="main2" for="main" class="col-md-4 control-label">Main</label>
<div class="col-md-6">
<textarea id="main" type="text" class="form-control" placeholder="Main Text"
title="More main text" name="main" value="{{ $entity->main }}">
</textarea>
@if ($errors->has('main'))
<span class="help-block">
<strong>{{ $errors->first('main') }}</strong>
</span>
@endif
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
但是,我得到的不是 db 的实际输出,而是空格,所以如果我点击该字段,感觉就像我按下了 Tab 3 次。如何解决?
我printData()在MyInterface.php和中创建了相同的方法,MyTrait.php我printData()从我的控制器调用方法来实现MyInterface.php和使用MyTrait.php.但是这个方法总是来自MyInterface.php.请解释一下为什么会这样?
MyInterface.php
<?php namespace App\Interfaces;
interface MyInterface
{
public function printData();
}
Run Code Online (Sandbox Code Playgroud)
MyTrait.php
<?php namespace App\Traits;
trait MyTrait
{
public function printData()
{
dd("From Trait");
}
}
Run Code Online (Sandbox Code Playgroud)
HomeController.php
<?php namespace App\Http\Controllers;
use App\Interfaces\MyInterface;
use App\Traits\MyTrait;
use App\User;
class HomeController extends Controller implements MyInterface
{
use MyTrait;
public function index()
{
$this->printData();
}
public function printData() {
// TODO: Implement printData() method.
dd("From Interface");
}
}
Run Code Online (Sandbox Code Playgroud)