SystemGroupData.php 853 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace app\models\system;
  3. use crmeb\basic\BaseModel;
  4. use crmeb\services\CacheService;
  5. use crmeb\traits\ModelTrait;
  6. class SystemGroupData extends BaseModel
  7. {
  8. use ModelTrait;
  9. /**
  10. * 根据id获取当前记录中的数据
  11. * @param $id
  12. * @return mixed
  13. * @throws \think\db\exception\DataNotFoundException
  14. * @throws \think\db\exception\ModelNotFoundException
  15. * @throws \think\exception\DbException
  16. */
  17. public static function getDateValue($id)
  18. {
  19. $value = self::alias('a')->where(array("id" => $id))->find();
  20. if (!$value) {
  21. return false;
  22. }
  23. $data["id"] = $value["id"];
  24. $fields = json_decode($value["value"], true);
  25. foreach ($fields as $index => $field) {
  26. $data[$index] = $field["value"];
  27. }
  28. return $data;
  29. }
  30. }