1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <?php
- /*
- * @Author: wang jun
- * @Date: 2022-01-18 10:57:14
- * @Last Modified by: wang jun
- * @Last Modified time: 2022-01-18 15:31:24
- * 微信类
- */
- namespace app\index\controller;
- use app\index\logic\userlogic;
- use think\Controller;
- class User extends Base
- {
- /**
- * 设置请求数据规则
- * 20220107
- * wj
- */
- protected function setrules()
- {
- $list = [
- 'newinfo' => [
- ['name' => 'openid', 'title' => 'openid', 'require' => true, 'type' => 'string'],
- ],
- 'realauth' => [
- ['name' => 'openid', 'title' => 'openid', 'require' => true, 'type' => 'string'],
- ],
- 'authcompany' => [
- ['name' => 'openid', 'title' => 'openid', 'require' => true, 'type' => 'string'],
- ],
- ];
- return $list;
- }
- public function newinfo()
- {
- $param = request()->param();
- $l_u = new userlogic();
- $id = $l_u->newinfo($param);
- if (empty($id)) {
- return backjson(0, "新增失败");
- }
- return backjson(1, "新增成功", ['id' => $id]);
- }
- public function realauth()
- {
- $param = request()->param();
- $l_u = new userlogic();
- $result = $l_u->realauthbyopenid($param);
- if (1 != $result['status']) {
- return backjson(0, $result['msg']);
- } else {
- return backjson(200, $result['data']);
- }
- }
- public function authcompany()
- {
- $param = request()->param();
- $l_u = new userlogic();
- $result = $l_u->updateiscompanybyopenid($param);
- if (1 != $result['status']) {
- return backjson(0, $result['msg']);
- } else {
- return backjson(200, $result['data']);
- }
- }
- }
|