ServiceTimeptype.php 716 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. namespace app\model;
  3. use think\Model;
  4. class ServiceTimeptype extends Model
  5. {
  6. protected $connection = 'mysql';
  7. protected $pk = 'id';
  8. protected $name = 'service_time_ptype';
  9. public static function getTitle($id = '')
  10. {
  11. if (empty($id)) {
  12. return '默认';
  13. }
  14. $data = self::where(['id' => $id])->find();
  15. if (!empty($data)) {
  16. $data = $data->toArray();
  17. }
  18. return $data['title'];
  19. }
  20. public static function getpcarray()
  21. {
  22. $data = self::field('id,title')->where(['weid' => weid()])->where('status', 1)->select()->toArray();
  23. $datalist = [];
  24. foreach ($data as $key => $vo) {
  25. $datalist[$key]['val'] = $vo['id'];
  26. $datalist[$key]['key'] = $vo['title'];
  27. }
  28. return $datalist;
  29. }
  30. }