|
|
@@ -50,9 +50,18 @@ class UserCert extends AuthController
|
|
|
*/
|
|
|
public function check($id = 0)
|
|
|
{
|
|
|
+ $info = Cert::get($id);
|
|
|
+ if (!$info) {
|
|
|
+ JsonService::fail('证书不存在');
|
|
|
+ }
|
|
|
$f = array();
|
|
|
- $f[] = Form::radio('status', '状态', '1')->setOptions([['value' => '1', 'label' => '通过'], ['value' => '2', 'label' => '不通过']]);
|
|
|
- $f[] = Form::select('level', '级别', '1')->setOptions([['value' => '1', 'label' => '低级'], ['value' => '2', 'label' => '中级'], ['value' => '3', 'label' => '高级'], ['value' => '4', 'label' => '特级']]);
|
|
|
+ $f[] = Form::input('name', '姓名', (string)$info['name'])->required();
|
|
|
+ $f[] = Form::frameImageOne('photo', '照片', Url::buildUrl('admin/widget.images/index', array('fodder' => 'image')), (string)$info['photo'])->required();
|
|
|
+ $f[] = Form::radio('gender', '状态', (string)$info['gender'])->setOptions([['value' => '0', 'label' => '男'], ['value' => '1', 'label' => '女']]);
|
|
|
+ $f[] = Form::input('idcard', '身份证号码', (string)$info['idcard'])->required();
|
|
|
+ $f[] = Form::input('job', '职业', (string)$info['job'])->required();
|
|
|
+ $f[] = Form::select('level', '级别', (string)$info['level'])->setOptions([['value' => '1', 'label' => '低级'], ['value' => '2', 'label' => '中级'], ['value' => '3', 'label' => '高级'], ['value' => '4', 'label' => '特级']]);
|
|
|
+ $f[] = Form::radio('status', '状态', (string)$info['status'])->setOptions([['value' => '0', 'label' => '待审核'], ['value' => '1', 'label' => '通过'], ['value' => '2', 'label' => '不通过']]);
|
|
|
$form = Form::make_post_form('确认证书', $f, Url::buildUrl('save_check', array('id' => $id)));
|
|
|
$this->assign(compact('form'));
|
|
|
return $this->fetch('public/form-builder');
|
|
|
@@ -64,11 +73,16 @@ class UserCert extends AuthController
|
|
|
*/
|
|
|
public function save_check($id)
|
|
|
{
|
|
|
- list($status, $level) = UtilService::postMore([
|
|
|
+ $data = UtilService::postMore([
|
|
|
+ ['name', ''],
|
|
|
+ ['photo', ''],
|
|
|
+ ['gender', 0],
|
|
|
+ ['idcard', ''],
|
|
|
+ ['job', ''],
|
|
|
['status', 0],
|
|
|
['level', 1]
|
|
|
- ], $this->request, true);
|
|
|
- $res = Cert::check_cert($id, $status, $level);
|
|
|
+ ], $this->request);
|
|
|
+ $res = Cert::check_cert($id, $data);
|
|
|
if ($res) {
|
|
|
return JsonService::success('已确认');
|
|
|
} else {
|