St_match_rule.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. namespace App\Http\Model;
  3. use Illuminate\Database\Eloquent\Model;
  4. use App\Http\Response\Response;
  5. /**
  6. * Class Account
  7. * @package App\Sports\Model
  8. * 赛事规则model
  9. */
  10. class St_match_rule extends Model
  11. {
  12. protected $table = 'st_match_rule';
  13. public $timestamps = false;
  14. /**
  15. * 获取赛事规则数据
  16. */
  17. function getList($limit = 0, $where = []){
  18. return $this->select('id','group_id','group_name','author','atime','utime','status','modular_name')->where($where)
  19. ->limit($limit)
  20. ->get()
  21. ->toArray();
  22. }
  23. /**
  24. * 添加赛事规则
  25. */
  26. function addMatchRule($data){
  27. $res=$this->insert($data);
  28. if(!$res){
  29. return -6030001222;
  30. }
  31. }
  32. /**
  33. * 获取当前id规则
  34. */
  35. function getDmsg($id=0) {
  36. $data = $this->find($id);
  37. if (!$data) {
  38. return -4010010122; //没有数据
  39. }
  40. return $data->toArray();
  41. }
  42. //禁用操作
  43. public function closeGame($where,$data){
  44. return $this->where($where)->update($data);
  45. }
  46. }