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