|
|
@@ -1280,7 +1280,29 @@ class Common
|
|
|
* 查询字段
|
|
|
* $value 字段值
|
|
|
*/
|
|
|
- static function filter_by_value ($array,$match_id){
|
|
|
+ static function filter_by_value ($array_l, $index, $value){
|
|
|
+ $data_json= json_encode($array_l);
|
|
|
+ $array = json_decode($data_json,true);
|
|
|
+ if(is_array($array) && count($array)>0)
|
|
|
+ {
|
|
|
+ foreach(array_keys($array) as $key){
|
|
|
+ $temp[$key] = $array[$key][$index];
|
|
|
+
|
|
|
+ if ($temp[$key] == $value){
|
|
|
+
|
|
|
+ $newarray = $array[$key];
|
|
|
+ return $newarray;
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // return $newarray;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ static function filter_by_value_1111 ($array,$match_id){
|
|
|
+ $data_json= json_encode($array);
|
|
|
+ $data_arr = json_decode($data_json,true);
|
|
|
|
|
|
|
|
|
/*
|
|
|
@@ -1304,23 +1326,24 @@ class Common
|
|
|
|
|
|
$newarray = [];
|
|
|
|
|
|
- if(is_array($array) && count($array)>0)
|
|
|
+ if(is_array($data_arr) && count($data_arr)>0)
|
|
|
{
|
|
|
- foreach($array as $k=>$v){
|
|
|
- if($v->match_id == $match_id){
|
|
|
- $newarray[$k] = [
|
|
|
- 'match_id'=> $v->match_id,
|
|
|
- 'home_score'=> $v->home_score,
|
|
|
- 'guest_score'=> $v->guest_score,
|
|
|
- 'a_time'=> $v->a_time,
|
|
|
- 'home_rate'=> $v->home_rate,
|
|
|
- 'guest_rate'=> $v->guest_rate,
|
|
|
- 'match_process'=> $v->match_process,
|
|
|
- 'first_score'=> $v->first_score,
|
|
|
- 'last_score'=> $v->last_score,
|
|
|
- 'match_score'=> $v->match_score,
|
|
|
- 'match_winer'=> $v->match_winer
|
|
|
- ];
|
|
|
+ foreach($data_arr as $k=>$v){
|
|
|
+ if($v['match_id'] == $match_id){
|
|
|
+ $newarray = $v;
|
|
|
+ // $newarray[$k] = [
|
|
|
+ // 'match_id'=> $v->match_id,
|
|
|
+ // 'home_score'=> $v->home_score,
|
|
|
+ // 'guest_score'=> $v->guest_score,
|
|
|
+ // 'a_time'=> $v->a_time,
|
|
|
+ // 'home_rate'=> $v->home_rate,
|
|
|
+ // 'guest_rate'=> $v->guest_rate,
|
|
|
+ // 'match_process'=> $v->match_process,
|
|
|
+ // 'first_score'=> $v->first_score,
|
|
|
+ // 'last_score'=> $v->last_score,
|
|
|
+ // 'match_score'=> $v->match_score,
|
|
|
+ // 'match_winer'=> $v->match_winer
|
|
|
+ // ];
|
|
|
}
|
|
|
|
|
|
}
|