12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- <?php
- namespace Factory\Admin;
- use Dever;
- class Info extends Core
- {
- # 获取基本信息
- public function getData()
- {
- $data = Dever::db('factory/info')->find($this->id);
- $url = Dever::url('api.get&level_total=2', 'area');
- $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>';
- if ($data['status'] == 2) {
- $data['status'] = '<span>认证状态:认证中</span>';
- } elseif ($data['status'] == 3) {
- $data['status'] = '<span>认证状态:认证失败</span> <a href="javascript:;" class="btn btn-primary layui-btn layuiadmin-btn-list layui-btn-danger">重新认证</a>';
- } else {
- $data['status'] = '<span>认证状态:已认证</span> <a href="javascript:;" class="btn btn-primary layui-btn layuiadmin-btn-list layui-btn-danger">重新认证</a>';
- }
- return $data;
- }
- # 获取基本信息
- public function getConfig()
- {
- # 修改资料
- $data['update'] = Dever::url('admin/info.update', 'factory');
- return $data;
- }
- # 认证
- public function update_api()
- {
- $input = Dever::input();
- $update['name'] = $input['update_name'];
- $update['truename'] = $input['update_truename'];
- $update['mobile'] = $input['update_mobile'];
- $update['area'] = $input['update_area'];
- $update['address'] = $input['update_address'];
- $update['license'] = $input['update_license'];
- $update['license_number'] = $input['update_license_number'];
- $update['idcard_front'] = $input['update_idcard_front'];
- $update['idcard_back'] = $input['update_idcard_back'];
- $update['kh_license'] = $input['update_kh_license'];
- $update['status'] = 2;
- $update['where_id'] = $this->id;
- Dever::db('factory/info')->update($update);
- return 'reload';
- }
- }
|