| 1234567891011121314151617181920212223242526272829303132333435363738 |
- <?php
- /**
- * Created by PhpStorm.
- * User: Jonlin
- * Date: 2019/3/28
- * Time: 9:05
- */
- namespace App\Models;
- use Illuminate\Support\Facades\DB;
- class SportsBase extends BaseModel {
- protected $table = "st_bq_competition";
- public $timestamps = false;
- function getInfos(){
- $data = DB::table('st_bq_competition')
- ->join('st_bq_league','st_bq_competition.lg_id','=','st_bq_league.id')
- ->select('st_bq_competition.id','st_bq_competition.lg_id','st_bq_league.name_chinese','st_bq_competition.home_team','st_bq_competition.guest_team','st_bq_competition.match_date','st_bq_competition.match_time')
- ->orderby('match_date','desc')
- ->orderby('match_time','desc')
- ->get();
- if(!$data){
- return -6010000122;
- }
- return $data->toArray();
- }
- //更新设置
- function updateInfos($data,$id){
- $res=$this->where('id',$id)->update($data);
- if(!$res) {
- return -7020050022;//更新失败
- }
- return 1;
- }
- }
|