SportsfootController.php 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522
  1. <?php
  2. namespace App\Http\Controllers\Admin;
  3. use App\Http\Controllers\Controller;
  4. use Illuminate\Http\Request as Req;
  5. use Illuminate\Support\Facades\DB;
  6. Use App\Lib\Settlement\SettlementOrder;
  7. use App\Models;
  8. use Request;
  9. /**
  10. *足球结算
  11. */
  12. class SportsfootController extends Controller {
  13. function Settlement(Req $req){
  14. $jsurl = config('sconstant.url');//结算请求域名地址
  15. $match_id = $req->match_id;
  16. $type = $req->type;
  17. $token = session('adminInfo.token');
  18. $notice = \App\Models\Comendnotice::where('match_id', $match_id)->first();
  19. $noticeid = $notice['id'];
  20. //查询赛事单式是否有订单
  21. $newapp = new \App\Models\MoneyBuyMatch();
  22. $simplex_ids = array_column($newapp->allsimplexorder($match_id,'zq'),'order_id');
  23. $str_ids = array_column($newapp->allstrorder($match_id),'order_id');
  24. if($simplex_ids && $str_ids){
  25. $requet = file_get_contents($jsurl."/WinFail?noticeid=".$noticeid."&token=".$token);
  26. if(json_decode($requet,true)['status']==1){
  27. //单式结算
  28. if($simplex_ids){
  29. $simplex = array(
  30. 'token'=>$token,
  31. 'order_ids'=>'', //订单id字符串,用半角都好分隔
  32. 'bettype'=>1, //结算类型 1单式 2串式
  33. 'settype'=>$type, //结算次数 1首次 2非首冷饮
  34. 'game_code'=>'zq', //赛事类型 zq lq wq bq
  35. 'match_id'=>$match_id, // 赛事ID
  36. 'change_status'=>1 //是否改状态
  37. );
  38. $url=$jsurl.'/Settelement';
  39. $newapp = new \App\Models\Stzqresult();
  40. $simplex_res = $newapp->post_curls($url,$simplex);//返回json
  41. $huawei_res = json_decode($simplex_res,true);
  42. }
  43. //串式结算
  44. if($str_ids){
  45. $tandem = array(
  46. 'token'=>$token,
  47. 'order_ids'=>'', //订单id字符串,用半角都好分隔
  48. 'bettype'=>2, //结算类型 1单式 2串式
  49. 'settype'=>$type, //结算次数 1首次 2非首冷饮
  50. 'game_code'=>'zq', //赛事类型 zq lq wq bq
  51. 'match_id'=>$match_id, // 赛事ID
  52. 'change_status'=>1 //是否改状态
  53. );
  54. $url=$jsurl.'/Settelement';
  55. $tandem_res = $newapp->post_curls($url,$tandem);//返回json
  56. $tandem_res = json_decode($tandem_res,true);
  57. }
  58. if($huawei_res['status']==1 || $tandem_res['status']==1){
  59. return json_encode(['status'=>1,'msg'=>'结算成功']);
  60. }else{
  61. return json_encode(['status'=>3,'msg'=>'结算有误,请联系管理员!!!']);//结算错误
  62. }
  63. }else{
  64. return json_encode(['status'=>2,'msg'=>'结算有错,请联系管理员!!!']);;//输赢错误
  65. }
  66. }else{
  67. $res = \App\Models\Stzqresult::where ('match_id', $match_id)->update(['status' =>3]);
  68. $res = \App\Models\SportsSoccer::where ('match_id', $match_id)->update(['status' =>3]);
  69. return json_encode(['status'=>4,'msg'=>'该赛事没有任何订单,将会结束该赛事!!!']);
  70. }
  71. }
  72. //足球结果列表
  73. function outcome(Req $req) {
  74. $request=array();
  75. $request['home_team'] = isset($req->home_team) ? trim($req->home_team) : null;
  76. $request['status'] = isset($req->status) ? trim($req->status) : '-1';
  77. $request['sureblurs'] = isset($req->sureblurs) ? $req->sureblurs : 'on';
  78. $request['star_time'] = isset($req->star_time) ? trim($req->star_time) :trans('status.default_time.seven_day') ;
  79. $request['end_time'] = isset($req->end_time) ? trim($req->end_time) : trans('status.default_time.etime');
  80. $newapp = new \App\Models\SoccerLeague();
  81. $data = $newapp->allleague();
  82. $request['league'] = $data;//联赛id
  83. $request['token'] = session('adminInfo.token');//token 变量
  84. $dt = \App\Lib\DataTable\DataTable::init();
  85. $dt->setDataSource('/admin/sportsfoot/outcomeinfo');
  86. $dt->setLang('sportsfoot');
  87. $dt->addColsFields('newtime', array('templet' => '#newtime', 'sort' => false, 'width' => 200));
  88. $dt->addColsFields('totime', array('templet' => '#totime', 'sort' => false, 'width' => 80));
  89. $dt->addColsFields('home_team', array('templet' => '#userdetail', 'sort' => false, 'width' => 80));
  90. $dt->addColsFields('guest_team', array('templet' => '#userdetail', 'sort' => false, 'width' => 70));
  91. $dt->addColsFields('dsnum', array('templet' => '#dsnum', 'sort' => false, 'width' => 70));
  92. $dt->addColsFields('csnum', array('templet' => '#csnum', 'sort' => false, 'width' => 110));
  93. $dt->addColsFields('sxalfcourt', array('templet' => '#sxalfcourt', 'sort' => false, 'width' => 300));
  94. $dt->addColsFields('statusmatch', array('templet' => '#statusmatch', 'sort' => false, 'width' => 150,'align' => 'left'));
  95. $dt->addColsFields('operation', array('templet' => '#status', 'sort' => false, 'width' => 300));
  96. // $arr[] = 'view';
  97. // if (checkRriv('/admin/sportsfoot/edit')) {
  98. // $arr[] = 'edit';
  99. // }
  100. // $dt->setToolBar($arr, array('width' => 200));
  101. $dt->enableCheckBox();
  102. return view('admin.sportsfoot/outcome', $dt->render($request));
  103. }
  104. //结果添加
  105. function addend(Req $req){
  106. $match_id = $req->matchid;
  107. $model = \App\Models\Stzqresult::where('match_id', $match_id)->first();
  108. $penaltycard = array(
  109. 'home'=>intval($req->homeallcard)?intval($req->homeallcard):0,
  110. 'guest'=>intval($req->guestallcard)?intval($req->guestallcard):0,
  111. 'home_half'=>intval($req->homehalfcard)?intval($req->homehalfcard):0,
  112. 'guest_half'=>intval($req->guesthalfcard)?intval($req->guesthalfcard):0,
  113. );
  114. $cornerball = array(
  115. 'home'=>intval($req->homeallcorner)?intval($req->homeallcorner):0,
  116. 'guest'=>intval($req->guestallcorner)?intval($req->guestallcorner):0,
  117. 'home_half'=>intval($req->homehalfcorner)?intval($req->homehalfcorner):0,
  118. 'guest_half'=>intval($req->guesthalfcorner)?intval($req->guesthalfcorner):0,
  119. );
  120. $firstone = array(
  121. 'teamscore'=>$req->firstscore ? $req->firstscore:0,
  122. 'scoretime'=>intval($req->onescoretime)?intval($req->onescoretime):0,
  123. 'scoretype'=>$req->firststye ? $req->firststye:0,
  124. );
  125. $model->last_score = $req->lastscore;
  126. $model->match_winer = $req->matchwiner;
  127. $model->penalty_card = json_encode($penaltycard);
  128. $model->corner_ball = json_encode($cornerball);
  129. $model->first_score = json_encode($firstone);
  130. $model->save();
  131. return responseToJson(1);
  132. }
  133. //查询赛事结果
  134. function Matchresult(Req $req){
  135. $match_id = $req->match_id;
  136. $newapp = \App\Models\Stzqresult::where('match_id', $match_id)->first();
  137. $array =array(
  138. 'corner_ball' => json_decode($newapp['corner_ball'],true),
  139. 'penalty_card' => json_decode($newapp['penalty_card'],true),
  140. 'first_score' => json_decode($newapp['first_score'],true),
  141. 'newapp' => $newapp,
  142. );
  143. return $array;
  144. }
  145. function onlyresult(Req $req){
  146. $match_id = $req->matchid;
  147. $newapp = \App\Models\Stzqresult::where('match_id', $match_id)->first();
  148. return $newapp;
  149. }
  150. //结算 allhalf全场1,半场0
  151. // function Settlement(Req $req){
  152. // $allhalf = $req->allhalf?$req->allhalf:'';
  153. // if(intval($allhalf)){
  154. // //赛事id
  155. // $id = $req->input('id');
  156. // if (empty($id)) {
  157. // return responseToJson(-2001); //
  158. // }
  159. // $ids = explode(',', $id);
  160. // if (!is_array($ids) && intval($ids) < 0) {
  161. // return responseToJson(-2002); //
  162. // }
  163. // if (is_array($ids) && count($ids) > 0) {
  164. // foreach ($ids as $k => $v) {
  165. // if (intval($v) < 1) {
  166. // unset($ids[$k]);
  167. // }
  168. // }
  169. // }
  170. // for ($i=0; $i < count($ids); $i++) {
  171. // $model = \App\Models\Stzqresult::where('id', $ids[$i])->select("match_id","status")->first();
  172. // //查询赛事下所有订单
  173. // $ssid = $model['match_id'];//赛事id
  174. // if($model['status']==2){
  175. // $type = 1;;//是否再结算1,首次结算2,再次结算
  176. // }else{
  177. // $type = 2;
  178. // }
  179. // $newapp = new \App\Models\MoneyBuyMatch();
  180. // $simplex_ids = array_column($newapp->allsimplexorder($ssid,'zq'),'order_id');
  181. // $str_ids = array_column($newapp->allstrorder($ssid),'order_id');
  182. // $data = \App\Models\Comendnotice::where(['match_id'=>$ssid,'game_code'=>'zq'])->first();
  183. // if($data){
  184. // $tapp = new \App\Lib\Settlement\SettlementWinFail();
  185. // \App\Models\Comendnotice::where(['match_id'=>$ssid,'game_code'=>'zq'])->update(['status'=>0]);
  186. // $ret = $tapp->doRun($data->toArray()['id']);
  187. // $ret2 =$data->toArray()['id'];
  188. // if ($ret2['status']==1){
  189. // \App\Models\Comendnotice::where(['match_id'=>$ssid,'game_code'=>'zq'])->update(['status'=>4]);
  190. // }
  191. // }
  192. // $SettlementOrder = new SettlementOrder();
  193. // $SettlementOrder->reSettlement($str_ids, 2,$type,'zq',$ssid,$allhalf);//串式
  194. // $data = $SettlementOrder->reSettlement($simplex_ids, 1,$type,'zq',$ssid,$allhalf);//单式注单
  195. // }
  196. // return responseToJson(1);
  197. // }else{
  198. // //查询赛事下所有订单
  199. // $ssid = $req->match_id;//赛事id
  200. // $type = $req->type;//是否再结算1,首次结算2,再次结算
  201. // $newapp = new \App\Models\MoneyBuyMatch();
  202. // $simplex_ids = array_column($newapp->allsimplexorder($ssid,'zq'),'order_id');
  203. // $str_ids = array_column($newapp->allstrorder($ssid),'order_id');
  204. // $data = \App\Models\Comendnotice::where(['match_id'=>$ssid,'game_code'=>'zq'])->first();
  205. // if($data){
  206. // $tapp = new \App\Lib\Settlement\SettlementWinFail();
  207. // \App\Models\Comendnotice::where(['match_id'=>$ssid,'game_code'=>'zq'])->update(['status'=>0]);
  208. // $ret = $tapp->doRun($data->toArray()['id']);
  209. // $ret2 =$data->toArray()['id'];
  210. // if ($ret2['status']==1){
  211. // \App\Models\Comendnotice::where(['match_id'=>$ssid,'game_code'=>'zq'])->update(['status'=>4]);
  212. // }
  213. // if($ret['status']==1){
  214. // $SettlementOrder = new SettlementOrder();
  215. // $SettlementOrder->reSettlement($str_ids, 2,$type,'zq',$ssid);//串式
  216. // $nda = $SettlementOrder->reSettlement($simplex_ids, 1,$type,'zq',$ssid);//单式注单
  217. // return responseToJson($nda);
  218. // }else{
  219. // return responseToJson($ret);
  220. // }
  221. // }
  222. // }
  223. // }
  224. //作废
  225. function revokeft(Req $req){
  226. $iszf = $req->iszf?$req->iszf:'';//赛事id
  227. if(intval($iszf)){
  228. $id = $req->input('id');
  229. if (empty($id)) {
  230. return responseToJson(-2001); //
  231. }
  232. $ids = explode(',', $id);
  233. if (!is_array($ids) && intval($ids) < 0) {
  234. return responseToJson(-2002); //
  235. }
  236. if (is_array($ids) && count($ids) > 0) {
  237. foreach ($ids as $k => $v) {
  238. if (intval($v) < 1) {
  239. unset($ids[$k]);
  240. }
  241. }
  242. }
  243. for ($ii=0; $ii < count($ids); $ii++) {
  244. $model = \App\Models\Stzqresult::where('id', $ids[$ii])->first();
  245. $model->status = 4;
  246. $model->save();
  247. $ssid = $model['match_id'];//赛事id
  248. $smodel = \App\Models\SportsSoccer::where('match_id', $ssid)->first();
  249. if($smodel){
  250. $smodel->status = 4;
  251. $smodel->save();
  252. }
  253. $upapp = new \App\Models\SportsNoteList();
  254. $data = $upapp->updatesimplex($ssid,'zq');//修改单式状态
  255. //单式撤单返现
  256. $newapp = new \App\Models\MoneyBuyMatch();
  257. $all = $newapp->allsimplexorder($ssid,'zq');
  258. for ($i=0; $i < count($all); $i++) {
  259. $appgx = new \App\Lib\Settlement\SettlementOrder();
  260. $appgx->insertData($all[$i]['order_id'], $all[$i]['money'], $all[$i]['account_identity'], '1', 'zq', $all[$i]['info_identity'], $all[$i]['money'],$all[$i]['match_id']);
  261. }
  262. //串式撤单只改状态
  263. $str_ids = array_column($newapp->allstrorder($ssid),'order_id');
  264. $csapp = new \App\Models\MoneyBuyStr();
  265. $csapp->updatestatus($str_ids);//var_dump($ss);die;
  266. //修改money_buy_match 投注结果result=2为平
  267. $newapp->updatast($ssid);
  268. }
  269. return responseToJson(1);
  270. }else{
  271. $match_id = $req->match_id;//赛事id
  272. $model = \App\Models\Stzqresult::where('match_id', $match_id)->first();
  273. $model->status = 4;
  274. $model->save();
  275. $smodel = \App\Models\SportsSoccer::where('match_id', $match_id)->first();
  276. if($smodel){
  277. $smodel->status = 4;
  278. $smodel->save();
  279. }
  280. $upapp = new \App\Models\SportsNoteList();
  281. $data = $upapp->updatesimplex($match_id,'zq');//修改单式状态
  282. //单式撤单返现
  283. $newapp = new \App\Models\MoneyBuyMatch();
  284. $all = $newapp->allsimplexorder($match_id,'zq');
  285. for ($i=0; $i < count($all); $i++) {
  286. $appgx = new \App\Lib\Settlement\SettlementOrder();
  287. $appgx->insertData($all[$i]['order_id'], $all[$i]['money'], $all[$i]['account_identity'], '1', 'zq', $all[$i]['info_identity'], $all[$i]['money'],$all[$i]['match_id']);
  288. }
  289. //串式撤单只改状态
  290. $str_ids = array_column($newapp->allstrorder($match_id),'order_id');
  291. $csapp = new \App\Models\MoneyBuyStr();
  292. $csapp->updatestatus($str_ids);//var_dump($ss);die;
  293. //修改money_buy_match 投注结果result=2为平
  294. $newapp->updatast($match_id);
  295. return responseToJson(1);
  296. }
  297. }
  298. //赛事结果修改
  299. function edit(Req $req) {
  300. $id = $req->id;
  301. if (intval($id) < 1) {
  302. return -1;
  303. }
  304. if (!$req->isMethod('post')) {
  305. $data = \App\Models\Stzqresult::where('id', $id)->first();
  306. if (!$data) {
  307. return -2;
  308. }
  309. $data = $data->toArray();
  310. return view('admin.sportsfoot/edit', $data);
  311. } else {
  312. $model = \App\Models\Stzqresult::where('id', $id)->first();
  313. $model->home_team = $req->input('home_team');
  314. $model->guest_team = $req->input('guest_team');
  315. $model->home_rate = $req->input('home_rate');
  316. $model->guest_rate = $req->input('guest_rate');
  317. $model->status = $req->input('status');
  318. //$model->update_time = time();
  319. $model->save();
  320. return responseToJson(1);
  321. }
  322. }
  323. function outcomeinfo() {
  324. $page = Request::has('page') ? Request::get('page') : '';
  325. $list = Request::has('limit') ? Request::get('limit') : 10;
  326. $home_team = Request::has('home_team') ? Request::get('home_team') : '';
  327. $sureblur = Request::has('sureblurs') ? Request::get('sureblurs') : 'off';
  328. $status = Request::has('status') ? Request::get('status') : '';
  329. $star_time = Request::get('star_time') ? Request::get('star_time').' 00:00:00' : '';
  330. $end_time = Request::get('end_time') ? Request::get('end_time').' 23:59:59' : '';
  331. $where = array();
  332. $orwhere = array();
  333. if (!empty($home_team)) {
  334. if (empty($sureblur) || $sureblur == 'off') {
  335. $where[] = array('st_zq_result.home_team', 'like', '%' . $home_team . '%');
  336. $orwhere[] = array('st_zq_result.guest_team', 'like', '%' . $home_team . '%');
  337. } else {
  338. if(is_numeric($home_team)){
  339. $where[] = array('st_zq_result.match_id', '=', $home_team);
  340. }else{
  341. $where[] = array('st_zq_result.home_team', '=', $home_team);
  342. $orwhere[] = array('st_zq_result.guest_team', '=', $home_team);
  343. }
  344. }
  345. }
  346. if ($status != -1) {
  347. $where[] = array('st_zq_result.status', '=', $status);
  348. $orwhere[] = array('st_zq_result.status', '=', $status);
  349. }
  350. if(!is_numeric($home_team)){
  351. if (!empty($star_time)) {
  352. $star_time = date('Y-m-d H:i:s', strtotime($star_time));
  353. $where[] = array('st_zq_result.start_time', '>', $star_time);
  354. $orwhere[] = array('st_zq_result.start_time', '>', $star_time);
  355. }
  356. if (!empty($end_time)) {
  357. $end_time = date('Y-m-d H:i:s', strtotime($end_time));
  358. $where[] = array('st_zq_result.start_time', '<', $end_time);
  359. $orwhere[] = array('st_zq_result.start_time', '<', $end_time);
  360. }
  361. }
  362. $newapp = new \App\Models\Stzqresult();
  363. $data = $newapp->resultlist($list, $page, $where, $orwhere);
  364. return \App\Lib\DataTable\DataTable::init()->toJson($data['data'], $data['total']);
  365. }
  366. function saislist(Req $req){
  367. $lgid = $req->lgid;//赛事id
  368. $newstzqcompetition = new \App\Models\Stzqcompetition();
  369. $league_data = $newstzqcompetition->allcompetition($lgid);//赛事id
  370. return $league_data;
  371. }
  372. //赛事结果添加 guest_score 客队进球 all_goal总进球数
  373. function addoutcome(Req $req) {
  374. if (!$req->isMethod('post')) {
  375. $lange = trans('menu');
  376. $newapp = new \App\Models\SoccerLeague();
  377. $league_data = $newapp->allleague();//联赛id
  378. return view('admin.sportsfoot/addoutcome',['data'=>$league_data]);
  379. } else {
  380. $match_id = trim($req->input('match_id'));//赛事id
  381. //添加足球比赛结果表
  382. $alldata = $req->input();
  383. unset($alldata['_token']);
  384. $all_goal = intval($alldata['home_score'])+intval($alldata['guest_score']);//总进球数
  385. $penaltycard = array(
  386. 'home'=>intval($alldata['homeallcard'])?intval($alldata['homeallcard']):0,
  387. 'guest'=>intval($alldata['guestallcard'])?intval($alldata['guestallcard']):0,
  388. 'home_half'=>intval($alldata['homehalfcard'])?intval($alldata['homehalfcard']):0,
  389. 'guest_half'=>intval($alldata['guesthalfcard'])?intval($alldata['guesthalfcard']):0,
  390. );
  391. $cornerball = array(
  392. 'home'=>intval($alldata['homeallcorner'])?intval($alldata['homeallcorner']):0,
  393. 'guest'=>intval($alldata['guestallcorner'])?intval($alldata['guestallcorner']):0,
  394. 'home_half'=>intval($alldata['homehalfcorner'])?intval($alldata['homehalfcorner']):0,
  395. 'guest_half'=>intval($alldata['guesthalfcorner'])?intval($alldata['guesthalfcorner']):0,
  396. );
  397. $ret = \App\Models\Stzqresult::updateOrCreate(['match_id'=>$match_id],array_merge($alldata,['match_time'=>'00:01','update_time'=>date('Y-m-d H:i:s'),'all_goal'=>$all_goal,'penalty_card'=>json_encode($penaltycard),'corner_ball'=>json_encode($cornerball)]));
  398. //添加足球比赛结果记录表
  399. \App\Models\Stzqresultrecord::updateOrCreate(['match_id'=>$match_id,'update_time'=>date('Y-m-d H:i:s')],array_merge($alldata,['match_time'=>'00:01','update_time'=>date('Y-m-d H:i:s')]));
  400. }
  401. return responseToJson(1);
  402. }
  403. //删除赛事结果
  404. function deleteoutcome(Req $req) {
  405. $id = $req->input('id');
  406. if (empty($id)) {
  407. return responseToJson(-2001); //
  408. }
  409. $ids = explode(',', $id);
  410. if (!is_array($ids) && intval($ids) < 0) {
  411. return responseToJson(-2002); //
  412. }
  413. if (is_array($ids) && count($ids) > 0) {
  414. foreach ($ids as $k => $v) {
  415. if (intval($v) < 1) {
  416. unset($ids[$k]);
  417. }
  418. }
  419. }
  420. $rows = \App\Models\Stzqresult::whereIn('id', $ids)->delete();
  421. if (!$rows) {
  422. return responseToJson(-2003);
  423. }
  424. return responseToJson(1);
  425. }
  426. //更新赛事比分
  427. function updatenum(Req $req){
  428. $type = $req->type;
  429. $id = $req->id;
  430. $num = $req->num;
  431. $match_id = $req->match_id;
  432. $newapp = new \App\Models\Stzqresult();
  433. if($type==1){
  434. $data['u_home_score'] = $num;
  435. $res = $newapp->updateInfo($data,$id);//联赛id
  436. }else if($type==2){
  437. $data['u_guest_score'] = $num;
  438. $res = $newapp->updateInfo($data,$id);//联赛id
  439. }else if($type==3){
  440. $data['home_score'] = $num;
  441. $res = $newapp->updateInfo($data,$id);//联赛id
  442. }else{
  443. $data['guest_score'] = $num;
  444. $res = $newapp->updateInfo($data,$id);//联赛id
  445. }
  446. $newapp->totalgoal($match_id);
  447. $update = $this->addcomendnotice($match_id);
  448. $twoapp = new \App\Models\SportsSoccer();
  449. $twoapp->updatestatus('match_id',$match_id,['status'=>2]);//修改赛事状态
  450. $newapp->updatestatus('match_id',$match_id,['status'=>2]);//修改结果状态
  451. return responseToJson(1);
  452. }
  453. //添加赛事结束纪录
  454. function addcomendnotice($match_id){
  455. $data = \App\Models\Comendnotice::where(['match_id'=>$match_id,'game_code'=>'zq'])->first();
  456. if(!$data){
  457. $model = new \App\Models\Comendnotice();
  458. $model->status = 0;//联赛id
  459. $model->game_code = 'zq';
  460. $model->match_id = $match_id;//赛事id
  461. $model->ctime = date('Y-m-d H:i:s');
  462. $model->save();
  463. }
  464. return responseToJson(1);
  465. }
  466. }