前后端增加 admin 权限检测

dev
zhaocheng 5 years ago
parent c8a31e44a5
commit 4b1e7ee6c6
  1. 4
      frontend/controllers/InsurerController.php
  2. 3
      frontend/views/insurer/my-list-info.php

@ -3512,7 +3512,7 @@ class InsurerController extends BaseController
$result['success'] = false;
$result['msg'] = '保存失败';
if ($request->isPost) {
if ($request->isPost && $this->my->id == 1) {
$id = $request->post('order_id', 0);
$order_info = OrderT::findOne($id);
@ -3537,6 +3537,8 @@ class InsurerController extends BaseController
$tran->rollBack();
$result['msg'] = $e->getMessage();
}
}else {
$result['msg'] = '当前用户无此权限';
}
return $result;
}

@ -350,7 +350,7 @@ use common\models\PriceT;
//
});
});
<?php if($order_info->gift_status == 1 && $my_id == 1) { ?>
$('.btn-cancel').click(function () {
parent.layer.confirm('此操作将回滚礼品状态,删除已生成礼物记录,确定继续?', {
btn: ['确认','取消'], //按钮
@ -364,6 +364,7 @@ use common\models\PriceT;
//
});
});
<?php } ?>
});
</script>
<?php $this->endBlock(); ?>

Loading…
Cancel
Save