userapplylogmodel.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. /*
  3. * @Author: wang jun
  4. * @Date: 2021-10-29 16:06:41
  5. * @Last Modified by: wang jun
  6. * @Last Modified time: 2021-10-29 16:15:16
  7. */
  8. namespace app\index\model;
  9. use think\Db;
  10. use think\Model;
  11. class userapplylogmodel extends Model
  12. {
  13. protected $table = 't_userapplylog';
  14. public function insertData($data)
  15. {
  16. $id = $this->insertGetId($data);
  17. return empty($id) ? false : $id;
  18. }
  19. public function getInfo($where, $field = "*", $row = true)
  20. {
  21. $info = $this->field($field)->where($where);
  22. if ($row) {
  23. $info = $info->find();
  24. } else {
  25. $info = $info->select();
  26. }
  27. return empty($info) ? false : $info;
  28. }
  29. public function updateinfo($where, $updateData)
  30. {
  31. $row = $this->where($where)->update($updateData);
  32. return empty($row) ? false : $row;
  33. }
  34. public function deleteinfo($where)
  35. {
  36. $row = $this->where($where)->delete();
  37. return empty($row) ? false : $row;
  38. }
  39. public function getList($where = [], $field = "*", $page = 1, $size = 10, $order = "id desc", $group = "", $row = false)
  40. {
  41. $sqlObj = $this->where($where);
  42. if ("count" != $field) {
  43. $sqlObj = $sqlObj->field($field)->order($order)->group($group)->page($page, $size);
  44. if ($row) {
  45. $data = $sqlObj->find();
  46. } else {
  47. $data = $sqlObj->select();
  48. }
  49. } else {
  50. $data = $sqlObj = $sqlObj->count();
  51. }
  52. return $data;
  53. }
  54. public function newxuuser($info)
  55. {
  56. $id = Db::table('t_wxuser')->insertGetId($info);
  57. return $id;
  58. }
  59. public function getxuuser($where)
  60. {
  61. $info = Db::table('t_wxuser')->where($where)->find();
  62. return $info;
  63. }
  64. }