1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- <?php
- /**
- * Created by PhpStorm.
- * User: sicilon_IT
- * Date: 2021/5/16
- * Time: 12:05
- */
- namespace app\index\model;
- use think\Model;
- class noticemodel extends Model{
- protected $table='t_notice';
- /*
- * 20210516
- */
- public function insinfo($arr){
- $this->allowField(true)->isUpdate(false)->setAttr('id',null)->save($arr);
- return $this->id;
- }
- /*
- * 20210517
- * 获取所有的有效公告接口
- */
- public function selalllist(){
- $where_arr['isactive']=1;
- $rlist=$this->where($where_arr)->order('id','desc')->select();
- $rlist=collection($rlist)->toArray();
- return $rlist;
- }
- /*
- * 20210517
- */
- public function selnewmsg(){
- $where_arr['isactive']=1;
- $rlist=$this->where($where_arr)->order('id','desc')->limit(0,1)->select();
- $rlist=collection($rlist)->toArray();
- return $rlist;
- }
- /*
- * 20230215
- */
- public function sellistbycid($cid){
- $where_arr['companyid']=$cid;
- $where_arr['isactive']=1;
- $rlist=$this->where($where_arr)->order('id','desc')->select();
- $rlist=collection($rlist)->toArray();
- return $rlist;
- }
- /*
- * 20230218
- */
- public function selnewmsgbycid($cid){
- $where_arr['isactive']=1;
- $where_arr['companyid']=$cid;
- $rlist=$this->where($where_arr)->order('id','desc')->limit(0,1)->select();
- $rlist=collection($rlist)->toArray();
- return $rlist;
- }
- }
|