select(); $tenim = new Tenim(); foreach($list as $key => $val){ $rs = $tenim->register('user_'. $val['id'], $val['nickname'], localpath_to_netpath($val['avatar'])); dump($rs); } // $list = Db::name('worker')->select(); $tenim = new Tenim(); foreach($list as $key => $val){ $rs = $tenim->register('master_'. $val['id'], $val['truename'], localpath_to_netpath($val['avatar'])); dump($rs); } // $list = Db::name('company')->select(); $tenim = new Tenim(); foreach($list as $key => $val){ $rs = $tenim->register('kefu_'. $val['id'], $val['companyname'], localpath_to_netpath($val['avatar'])); dump($rs); } } /** * 测试方法 * * @ApiTitle (测试名称) * @ApiSummary (测试描述信息) * @ApiMethod (POST) * @ApiRoute (/api/demo/test/id/{id}/name/{name}) * @ApiHeaders (name=token, type=string, required=true, description="请求的Token") * @ApiParams (name="id", type="integer", required=true, description="会员ID") * @ApiParams (name="name", type="string", required=true, description="用户名") * @ApiParams (name="data", type="object", sample="{'user_id':'int','user_name':'string','profile':{'email':'string','age':'integer'}}", description="扩展数据") * @ApiReturnParams (name="code", type="integer", required=true, sample="0") * @ApiReturnParams (name="msg", type="string", required=true, sample="返回成功") * @ApiReturnParams (name="data", type="object", sample="{'user_id':'int','user_name':'string','profile':{'email':'string','age':'integer'}}", description="扩展数据返回") * @ApiReturn ({ 'code':'1', 'msg':'返回成功' }) */ public function test() { $data = [ [ 'type' => 'video', 'url' => '/upload/20240712/aaaaa.mp4', ], [ 'type' => 'img', 'url' => '/upload/20240712/bbbbb.jpg', ], [ 'type' => 'video', 'url' => '/upload/20240712/ccccc.mp4', ], [ 'type' => 'img', 'url' => '/upload/20240712/ddddd.png', ], ]; echo json_encode($data); } /** * 无需登录的接口 * */ public function test1() { $rule = '246,230,240,259,260,317,253,261,262,263,100,265,102,103,104,120,267,269,270,110,266,113,114,289,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,271,272,274,290,280,281,282,283,284,286,273,278,279,275,276,277,291,292,293'; $rule = explode(',',$rule); dump($rule); $b = array_count_values($rule); dump($b); } /** * 需要登录的接口 * */ public function test2() { $this->success('返回成功', ['action' => 'test2']); } /** * 需要登录且需要验证有相应组的权限 * */ public function test3() { $this->success('返回成功', ['action' => 'test3']); } }