EventRegistration.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\admin\model\ump;
  12. use traits\ModelTrait;
  13. use basic\ModelBasic;
  14. use think\Db;
  15. class EventRegistration extends ModelBasic
  16. {
  17. use ModelTrait;
  18. public static function systemPage($where = array()){
  19. $model = self::setWherePage(self::setWhere($where));
  20. $model = $model->where('is_del',0)->order('add_time DESC');
  21. $list = $model ->page((int)$where['page'], (int)$where['limit'])->select()->each(function ($item){
  22. $item['address']=$item['province'].$item['city'].$item['district'].$item['detail'];
  23. });
  24. $count = self::setWherePage(self::setWhere($where))->count();
  25. return ['count' => $count, 'data' => $list];
  26. }
  27. /**
  28. * 设置搜索条件
  29. *
  30. */
  31. public static function setWhere($where)
  32. {
  33. $model=new self;
  34. if ($where['title'] != '') {
  35. $model = $model->where('title','like',"%$where[title]%");
  36. }
  37. return $model;
  38. }
  39. /**删除
  40. * @param $id
  41. * @return bool
  42. */
  43. public static function delArticleCategory($id){
  44. $data['is_del']=1;
  45. return self::edit($data,$id);
  46. }
  47. }