Info.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. namespace Factory\Admin;
  3. use Dever;
  4. class Info extends Core
  5. {
  6. # 获取基本信息
  7. public function getData()
  8. {
  9. $data = Dever::db('factory/info')->find($this->id);
  10. $url = Dever::url('api.get&level_total=2', 'area');
  11. $data['area'] = '<script>function linkage_update_area(level){select_linkage(level, "dever-linkage-update_area","'.$url.'", "update_area", "'.$data['area'].'", "", "margin-top:0px;width:20%;", false, "", "", "", "", "", "", "")};$(document).ready(function(){linkage_update_area(1);});</script>';
  12. if ($data['status'] == 2) {
  13. $data['status'] = '<span>认证状态:认证中</span>';
  14. } elseif ($data['status'] == 3) {
  15. $data['status'] = '<span>认证状态:认证失败</span>&nbsp;&nbsp;<a href="javascript:;" class="btn btn-primary layui-btn layuiadmin-btn-list layui-btn-danger">重新认证</a>';
  16. } else {
  17. $data['status'] = '<span>认证状态:已认证</span>&nbsp;&nbsp;<a href="javascript:;" class="btn btn-primary layui-btn layuiadmin-btn-list layui-btn-danger">重新认证</a>';
  18. }
  19. return $data;
  20. }
  21. # 获取基本信息
  22. public function getConfig()
  23. {
  24. # 修改资料
  25. $data['update'] = Dever::url('admin/info.update', 'factory');
  26. return $data;
  27. }
  28. # 认证
  29. public function update_api()
  30. {
  31. $input = Dever::input();
  32. $update['name'] = $input['update_name'];
  33. $update['truename'] = $input['update_truename'];
  34. $update['mobile'] = $input['update_mobile'];
  35. $update['area'] = $input['update_area'];
  36. $update['address'] = $input['update_address'];
  37. $update['license'] = $input['update_license'];
  38. $update['license_number'] = $input['update_license_number'];
  39. $update['idcard_front'] = $input['update_idcard_front'];
  40. $update['idcard_back'] = $input['update_idcard_back'];
  41. $update['kh_license'] = $input['update_kh_license'];
  42. $update['status'] = 2;
  43. $update['where_id'] = $this->id;
  44. Dever::db('factory/info')->update($update);
  45. return 'reload';
  46. }
  47. }