|
@@ -3,7 +3,7 @@
|
|
|
* @Author: wang jun
|
|
|
* @Date: 2022-01-18 10:57:14
|
|
|
* @Last Modified by: wang jun
|
|
|
- * @Last Modified time: 2022-01-18 15:31:24
|
|
|
+ * @Last Modified time: 2022-01-19 10:26:29
|
|
|
* 微信类
|
|
|
*/
|
|
|
namespace app\index\controller;
|
|
@@ -13,35 +13,15 @@ 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, "新增失败");
|
|
|
+ $result = $l_u->newinfo($param);
|
|
|
+ if (1 != $result['status']) {
|
|
|
+ return backjson(0, $result['msg']);
|
|
|
}
|
|
|
- return backjson(1, "新增成功", ['id' => $id]);
|
|
|
+ return backjson(200, $result['data']);
|
|
|
}
|
|
|
public function realauth()
|
|
|
{
|
|
@@ -50,9 +30,8 @@ class User extends Base
|
|
|
$result = $l_u->realauthbyopenid($param);
|
|
|
if (1 != $result['status']) {
|
|
|
return backjson(0, $result['msg']);
|
|
|
- } else {
|
|
|
- return backjson(200, $result['data']);
|
|
|
}
|
|
|
+ return backjson(200, $result['data']);
|
|
|
}
|
|
|
public function authcompany()
|
|
|
{
|
|
@@ -61,8 +40,7 @@ class User extends Base
|
|
|
$result = $l_u->updateiscompanybyopenid($param);
|
|
|
if (1 != $result['status']) {
|
|
|
return backjson(0, $result['msg']);
|
|
|
- } else {
|
|
|
- return backjson(200, $result['data']);
|
|
|
}
|
|
|
+ return backjson(200, $result['data']);
|
|
|
}
|
|
|
}
|