|
|
@@ -58,6 +58,88 @@ class SoccerNoteListController extends Controller
|
|
|
return view('sports/sports_notelist', $dt->render($request));
|
|
|
}
|
|
|
|
|
|
+ //修改冠军单订单结果
|
|
|
+ function orderupgj(Req $req){
|
|
|
+ $id = $req->id;//37
|
|
|
+ $orderid = $req->order;//S20190916094723915270970
|
|
|
+ if (intval($id) < 1) {
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+
|
|
|
+ $data = \App\Models\SoccerLeague::where('id',$id)->first();
|
|
|
+
|
|
|
+ $odds_code = \App\Models\SoccerOdds::where('lg_id',$id)->where('type',1)->where('odds_code','!=','')->select('odds_code')->distinct()->get()->toArray();//赔率表
|
|
|
+
|
|
|
+ for ($i=0; $i < count($odds_code); $i++) {
|
|
|
+ $allteam[] = \App\Models\SoccerOdds::where('odds_code',$odds_code[$i]['odds_code'])->where('lg_id',$id)->where('type',1)->select('team')->distinct()->get()->toArray();
|
|
|
+ }
|
|
|
+
|
|
|
+ $data = $data->toArray();
|
|
|
+ $isdisplay = \App\Models\Stwqleagueresult::where(['lg_id'=>$id,'status'=>1])->select("game_name")->distinct()->get()->toArray();
|
|
|
+ $idisplay = array_column($isdisplay,'game_name');
|
|
|
+ $displays = implode(",",$idisplay);//转换成字符串
|
|
|
+
|
|
|
+ //新增纪录
|
|
|
+ foreach($odds_code as $k => $v) {
|
|
|
+ foreach($allteam[$k] as $kk => $vv) {
|
|
|
+ $name = $v['odds_code'];
|
|
|
+ $isteam = $allteam[$k][$kk]['team'];
|
|
|
+ $res = \App\Models\Stwqleagueresult::where(['lg_id'=>$id,'game_name'=>$name,'result'=>$isteam])->first();
|
|
|
+
|
|
|
+ $addresult = [
|
|
|
+ 'lg_id' => $id,
|
|
|
+ 'game_name' => $name,
|
|
|
+ 'result' => $isteam,
|
|
|
+ 'ctime' => date('Y-m-d H:i:s',time()),
|
|
|
+ 'status' => 0,
|
|
|
+ 'updated_at' => date('Y-m-d H:i:s',time()),
|
|
|
+ ];
|
|
|
+
|
|
|
+ if(empty($res)){
|
|
|
+ \App\Models\Stwqleagueresult::insert($addresult);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $orderjg = \App\Models\SportsNoteList::where(['order_id'=>$orderid])->select("single_result")->first();
|
|
|
+ $orderjg = json_decode($orderjg['single_result'],true);
|
|
|
+
|
|
|
+ $data['allteam'] = $allteam;
|
|
|
+ $data['odds_code'] = $odds_code;
|
|
|
+ $data['displays'] = $displays;
|
|
|
+ $data['isdisplay'] = $isdisplay;
|
|
|
+ $data['orderjg'] = $orderjg;
|
|
|
+ $data['orderid'] = $orderid;
|
|
|
+ $data['lg_id'] = $id;
|
|
|
+
|
|
|
+ return view('sports/orderupgj',$data);
|
|
|
+ }
|
|
|
+
|
|
|
+ //修改冠军单订单结果提交
|
|
|
+ function ajaxtj(Req $req){
|
|
|
+ $isstatus = $req->isstatus;//更新
|
|
|
+ $order = $req->order;
|
|
|
+
|
|
|
+ if($isstatus){
|
|
|
+ $gjresult = array(
|
|
|
+ 'lg_id'=>$req->lg_id?$req->lg_id:'',
|
|
|
+ 'game_name'=> $req->odds_code?$req->odds_code:'',
|
|
|
+ 'result'=> $req->team?$req->team:'',
|
|
|
+ 'updatetime' => date("Y-m-d H:i:s",time()),
|
|
|
+ );
|
|
|
+ }else{
|
|
|
+ $gjresult = array(
|
|
|
+ 'lg_id'=>'',
|
|
|
+ 'game_name'=>'',
|
|
|
+ 'result'=>'',
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ \App\Models\SportsNoteList::where(['order_id'=>$order])->update(['single_result'=>json_encode($gjresult,JSON_UNESCAPED_UNICODE)]);
|
|
|
+
|
|
|
+ return responseToJson(1);
|
|
|
+ }
|
|
|
+
|
|
|
function info()
|
|
|
{
|
|
|
$page = Request::has('page') ? Request::get('page') : '';
|
|
|
@@ -485,11 +567,11 @@ class SoccerNoteListController extends Controller
|
|
|
public function delete(Req $req) {
|
|
|
$id = $req->input('id');
|
|
|
if (empty($id)) {
|
|
|
- return responseToJson(-2001); //id������
|
|
|
+ return responseToJson(-2001); //id
|
|
|
}
|
|
|
$ids = explode(',', $id);
|
|
|
if (!is_array($ids) && intval($ids) < 0) {
|
|
|
- return responseToJson(-2002); //id����
|
|
|
+ return responseToJson(-2002); //id
|
|
|
}
|
|
|
if (is_array($ids) && count($ids) > 0) {
|
|
|
foreach ($ids as $k => $v) {
|
|
|
@@ -501,9 +583,9 @@ class SoccerNoteListController extends Controller
|
|
|
|
|
|
$rows = \App\Models\SportsNoteList::whereIn('id', $ids)->delete();
|
|
|
if (!$rows) {
|
|
|
- return responseToJson(-2003); //id����
|
|
|
+ return responseToJson(-2003); //id
|
|
|
}
|
|
|
- return responseToJson(1, trans('menu.delete_success')); //id����
|
|
|
+ return responseToJson(1, trans('menu.delete_success')); //id
|
|
|
|
|
|
}
|
|
|
|