Comendnotice.php 767 B

1234567891011121314151617181920212223242526272829
  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. protected $fillable=['status','pcount','logs','game_code','match_id','result','done_time','start_time','ctime'];
  14. //添加赛事结束纪录
  15. function addcomendnotice($match_id,$type){
  16. $data = $this->where(['match_id'=>$match_id,'game_code'=>$type])->first();
  17. if(!$data){
  18. $res=$this->insert(['game_code'=>$type,'pcount'=>1,'match_id'=>$match_id,'ctime'=>date('Y-m-d H:i:s')]);
  19. if(!$res){
  20. return -6030001222;
  21. }
  22. }
  23. return 1;
  24. }
  25. }