Comendnotice.php 650 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. /**
  3. *------Create thems Model------
  4. *------SCWPHP Version 1.0.0------
  5. *------Dev Model Jions------
  6. *------Create Time 2017-06-13 18:45:24------
  7. */
  8. namespace App\Models;
  9. use DB;
  10. class Comendnotice extends BaseModel {
  11. protected $table = 'comendnotice';
  12. public $timestamps = false;
  13. //添加赛事结束纪录
  14. function addcomendnotice($match_id,$type){
  15. $data = $this->where(['match_id'=>$match_id,'game_code'=>$type])->first();
  16. if(!$data){
  17. $res=$this->insert(['game_code'=>$type,'pcount'=>1,'match_id'=>$match_id,'ctime'=>date('Y-m-d H:i:s')]);
  18. if(!$res){
  19. return -6030001222;
  20. }
  21. }
  22. return 1;
  23. }
  24. }