123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- <?php
- /*
- * @Author: wang jun
- * @Date: 2022-01-18 10:57:14
- * @Last Modified by: wang jun
- * @Last Modified time: 2022-01-18 16:56:01
- * 微信类
- */
- namespace app\index\controller;
- use app\index\logic\companylogic;
- use think\Controller;
- class Company extends Base
- {
- /**
- * 设置请求数据规则
- * 20220107
- * wj
- */
- protected function setrules()
- {
- $list = [
- 'newinfo' => [
- ['name' => 'openid', 'title' => 'openid', 'require' => true, 'type' => 'string'],
- ],
- 'getinfobyid' => [
- ['name' => 'id', 'title' => 'id', 'require' => true, 'type' => 'string'],
- ],
- 'updatebyid' => [
- ['name' => 'id', 'title' => 'id', 'require' => true, 'type' => 'string'],
- ],
- ];
- return $list;
- }
- public function newinfo()
- {
- $param = request()->param();
- $l_c = new companylogic();
- $result = $l_c->newinfo($param);
- if (1 != $result['status']) {
- return backjson(0, $result['msg']);
- }
- return backjson(200, $result['data']);
- }
- public function getinfobyid()
- {
- $param = request()->param();
- $l_c = new companylogic();
- $result = $l_c->getinfobyid($param);
- if (1 != $result['status']) {
- return backjson(0, $result['msg']);
- }
- return backjson(200, $result['data']);
- }
- public function updatebyid()
- {
- $param = request()->param();
- $l_c = new companylogic();
- $result = $l_c->updatebyid($param);
- if (1 != $result['status']) {
- return backjson(0, $result['msg']);
- }
- return backjson(200, $result['data']);
- }
- }
|