ChatUsers.php 792 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: Lenovo
  5. * Date: 2018/10/30
  6. * Time: 15:09
  7. */
  8. namespace App\Models;
  9. class ChatUsers extends BaseModel
  10. {
  11. protected $table = 'chat_users';
  12. function getlist($where,$limit ){
  13. return $this->where($where)
  14. ->limit($limit)
  15. ->get()
  16. ->toArray();
  17. }
  18. function addRecord($data){
  19. $res=$this->insert($data);
  20. if(!$res){
  21. return -6030001222;
  22. }
  23. }
  24. function getIdData($id){
  25. return $this->where("id",$id)->first();
  26. }
  27. public function updateIdData(int $id,$data){
  28. return $this->where("id",$id)->update($data);
  29. }
  30. }