123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799 |
- <?php
- namespace app\api\controller;
- use app\common\library\Common;
- use think\Console;
- use think\Db;
- use think\Request;
- use app\common\model\User as Users;
- use think\facade\Validate;
- use app\common\controller\Api;
- /**
- * @title 个人中心
- * @controller User
- * @group user
- */
- class User extends Api
- {
- /**
- * @title 获取用户信息
- * @desc 获取用户信息
- * @url /api/User/userinfo
- * @method POST
- * @tag 基础
- * @header name:Authorization require:1 default: desc:验证token
- */
- public function userinfo(){
- $user_id = $this->check_login();
- $userinfo = Users::getUserInfo($user_id);
- $this->success('成功',$userinfo);
- }
- /**
- * @title 收货地址列表
- * @desc 我的收货地址
- * @url /api/User/my_address
- * @method POST
- * @tag 基础
- * @header name:Authorization require:1 default: desc:验证token
- * @param name:page type:int require:0 default:1 desc:
- * @param name:limit type:int require:0 default:10 desc:
- */
- public function my_address(){
- $user_id = $this->check_login();
- $Nowpage = input('page',1);
- $limits = input("limit",10);
- $result = Users::MyAddress($user_id,$Nowpage,$limits);
- $this->success('成功',$result['data']);
- }
- /**
- * @title 添加、修改收货地址
- * @desc 添加、修改收货地址
- * @url /api/User/add_edit_address
- * @method POST
- * @tag 基础
- * @header name:Authorization require:1 default: desc:验证token
- * @param name:name type:string require:1 default: desc:收货人姓名
- * @param name:phone type:string require:1 default: desc:手机号
- * @param name:province type:string require:1 default: desc:省
- * @param name:city type:string require:1 default: desc:市
- * @param name:area type:string require:1 default: desc:区
- * @param name:address type:string require:1 default: desc:具体地址
- * @param name:is_default type:int require:0 default:0 desc:默认地址1:默认0:否
- * @param name:jd type:string require:0 default:0 desc:经度
- * @param name:wd type:string require:0 default:0 desc:纬度
- * @param name:address_id type:int require:0 default:0 desc:收货地址ID,有则修改,无则添加
- */
- public function add_edit_address(){
- $user_id = $this->check_login();
- $data['name'] = input('name'); //收货人姓名
- $data['phone'] = input('phone'); //手机号
- $data['province'] = input('province'); //省
- $data['city'] = input('city'); //市
- $data['area'] = input('area'); //区
- $data['address'] = input('address'); //具体地址
- $data['is_default'] = input('is_default',0); //默认地址 1:默认
- $data['jd'] = input('jd'); //经度
- $data['wd'] = input('wd'); //纬度
- $address_id = intval(input('address_id')); //收货地址ID 有则修改,无则添加
- if (!$data['name'] || !$data['phone'] || !$data['province'] || !$data['city'] || !$data['area'] || !$data['address']) $this->error('参数错误');
- if (!Validate::regex($data['phone'], "^1\d{10}$")) $this->error('手机号格式错误');
- $result = Users::AddEditAddress($user_id,$data,$address_id);
- if ($result['code']){
- $this->success($result['msg']);
- }else{
- $this->error($result['msg']);
- }
- }
- /**
- * @title 设为默认地址
- * @desc 设为默认地址
- * @url /api/User/set_address_default
- * @method POST
- * @tag 基础
- * @header name:Authorization require:1 default: desc:验证token
- * @param name:address_id type:int require:1 default:1 desc:地址ID
- */
- public function set_address_default(){
- $user_id = $this->check_login();
- $address_id = intval(input('address_id')); //地址ID
- if (!$address_id) $this->error('地址ID为空');
- $result = Users::SetAddressDefault($user_id,$address_id);
- if ($result['code']){
- $this->success($result['msg']);
- }else{
- $this->error($result['msg']);
- }
- }
- /**
- * @title 删除地址
- * @desc 删除地址
- * @url /api/User/del_address
- * @method POST
- * @tag 基础
- * @header name:Authorization require:1 default: desc:验证token
- * @param name:address_id type:int require:1 default:1 desc:地址ID
- */
- public function del_address(){
- $user_id = $this->check_login();
- $address_id = intval(input('address_id')); //地址ID
- if (!$address_id) $this->error('地址ID为空');
- $result = Users::DelAddress($user_id,$address_id);
- if ($result['code']){
- $this->success($result['msg']);
- }else{
- $this->error($result['msg']);
- }
- }
- /**
- * @title 修改个人资料
- * @desc 修改个人资料
- * @url /api/User/edit_user_info
- * @method POST
- * @tag 基础
- * @header name:Authorization require:1 default: desc:验证token
- * @param name:headimg type:string require:0 default:1 desc:头像
- * @param name:nickname type:string require:0 default:1 desc:昵称
- */
- public function edit_user_info(){
- $user_id = $this->check_login();
- $data = input();
- $result = Users::EditUserInfo($user_id,$data);
- if ($result['code']){
- $this->success($result['msg']);
- }else{
- $this->error($result['msg']);
- }
- }
- /**
- * @title 修改密码
- * @desc 修改密码
- * @url /api/User/change_password
- * @method POST
- * @tag 基础
- * @header name:Authorization require:1 default: desc:验证token
- *
- * @param name:password type:string require:0 desc:密码
- * @param name:confirm_password type:string require:0 desc:确认密码
- * @param name:ver_code type:string require:0 desc:验证码
- */
- public function change_password(){
- $user_id = $this->check_login();
- $password = input('password'); //密码
- $confirm_password = input('confirm_password'); //确认密码
- $ver_code = input('ver_code'); //验证码
- if (!$password || !$ver_code || !$confirm_password){
- $this->error('参数错误');
- }
- if ($password!=$confirm_password){
- $this->error('密码与确认密码不一致');
- }
- $result = Users::changePassword($user_id,$password,$ver_code);
- if ($result['code']){
- $this->success($result['msg']);
- }else{
- $this->error($result['msg']);
- }
- }
- /**
- * @title 申请成为设计师
- * @desc 申请成为设计师
- * @url /api/User/apply_designer
- * @method POST
- * @tag 基础
- * @header name:Authorization require:1 default: desc:验证token
- *
- * @param name:name type:string require:1 desc:姓名
- * @param name:design_classifi type:string require:1 desc:设计分类
- * @param name:skills_label type:string require:1 desc:技能标签
- * @param name:good_type type:string require:1 desc:擅长类型
- * @param name:good_style type:string require:1 desc:擅长风格
- * @param name:province type:string require:1 desc:省
- * @param name:city type:string require:1 desc:市
- * @param name:area type:string require:1 desc:区
- * @param name:work_experience type:string require:1 desc:工作经历
- * @param name:work_year type:string require:1 desc:工作年限
- * @param name:identity_card_zheng type:string require:1 desc:身份证正面
- * @param name:identity_card_fan type:string require:1 desc:身份证反面
- * @param name:related_certificate type:string require:1 desc:相关证书,数组
- * @param name:works type:string require:1 desc:作品,数组
- * @param name:wd type:string require:1 desc:当前位置纬度
- * @param name:jd type:string require:1 desc:当前位置经度
- */
- public function apply_designer(){
- $user_id = $this->check_login();
- $data['name'] = input('name'); //姓名
- $data['design_classifi'] = input('design_classifi'); //设计分类
- $data['skills_label'] = input('skills_label'); //技能标签
- $data['good_type'] = input('good_type'); //擅长类型
- // $data['good_style'] = input('good_style'); //擅长风格
- $data['province'] = input('province'); //省
- $data['city'] = input('city'); //市
- $data['area'] = input('area'); //区
- // $data['work_experience'] = input('work_experience'); //工作经历
- $data['work_year'] = input('work_year'); //工作年限
- $data['identity_card_zheng'] = input('identity_card_zheng'); //身份证正面
- $data['identity_card_fan'] = input('identity_card_fan'); //身份证反面
- $data['related_certificate'] = input('related_certificate'); //相关证书
- $data['works'] = input('works'); //作品
- $data['wd'] = input('wd'); //当前位置纬度
- $data['jd'] = input('jd'); //当前位置经度
- if (!$data['name'] || !$data['design_classifi'] || !$data['design_classifi'] || !$data['skills_label'] || !$data['good_type'] || !$data['identity_card_zheng'] || !$data['identity_card_fan'] || !$data['province']
- || !$data['city'] || !$data['area'] || !$data['work_year'] || !$data['works']){
- $this->error('参数错误');
- }
- $data['related_certificate'] = implode(',',$data['related_certificate']);
- $data['works'] = implode(',',$data['works']);
- $data['skills_label'] = implode(',',$data['skills_label']);
- $data['good_type'] = implode(',',$data['good_type']);
- $result = Users::applyDesigner($user_id,$data);
- if ($result['code']){
- $this->success($result['msg']);
- }else{
- $this->error($result['msg']);
- }
- }
- /**
- * @title 投诉提交
- * @desc 投诉提交
- * @url /api/User/message
- * @method POST
- * @tag 基础
- * @header name:Authorization require:1 default: desc:验证token
- *
- * @param name:content type:string require:0 desc:内容
- */
- public function message(){
- $user_id = $this->check_login();
- $content = input('content'); //内容
- if (!$content) $this->error('参数错误');
- $result = Users::Message($user_id,$content);
- if ($result['code']){
- $this->success($result['msg']);
- }else{
- $this->error($result['msg']);
- }
- }
- /**
- * @title 时间管理列表
- * @desc 时间管理列表
- * @url /api/User/time_list
- * @method POST
- * @tag 基础
- * @header name:Authorization require:1 default: desc:验证token
- *
- *
- * @return name:switch type:int desc:1:开启2:关闭
- * @return name:date type:int desc:日期
- * @return name:price type:int desc:价格
- */
- public function time_list(){
- $user_id = $this->check_login();
- $result = Users::timeList($user_id);
- $this->success('成功',$result['data']);
- }
- /**
- * @title 时间设置开关
- * @desc 时间设置开关
- * @url /api/User/time_switch
- * @method POST
- * @tag 基础
- * @header name:Authorization require:1 default: desc:验证token
- *
- * @param name:json type:json require:1 desc:json
- */
- public function time_switch(){
- $user_id = $this->check_login();
- $json = input('json');
- // $date = input('date'); //日期
- // $switch = input('switch'); //1:开 2:关
- // $price = input('price'); //价格
- // if (!$date || !$switch || !$price || $price<=0) $this->error('参数错误');
- if (!$json) $this->error('参数错误');
- // $result = Users::timeSwitch($user_id,$date,$switch,$price);
- $json = json_decode($json,true);
- $result = Users::timeSwitch($user_id,$json);
- if ($result['code']){
- $this->success($result['msg']);
- }else{
- $this->error($result['msg']);
- }
- }
- /**
- * @title 设计师端余额提现
- * @desc 设计师端余额提现
- * @url /api/User/user_withdraw
- * @method POST
- * @tag 基础
- * @header name:Authorization require:1 default: desc:验证token
- *
- * @param name:money type:string require:0 desc:金额
- * @param name:withdraw_type type:string require:0 desc:提现方式weixin:微信zfb:支付宝
- */
- public function user_withdraw(){
- $user_id = $this->check_login();
- $money = input('money'); //提现金额
- $withdraw_type = input('withdraw_type'); //提现方式
- if (!in_array($withdraw_type,array('weixin','zfb'))) $this->error('提现方式错误');
- if (!$money || $money<=0) $this->error('金额错误');
- $result = Users::userWithdraw($user_id,$money,$withdraw_type);
- if ($result['code']){
- $this->success($result['msg']);
- }else{
- $this->error($result['msg']);
- }
- }
- /**
- * @title 设计师端消费明细
- * @desc 设计师端消费明细
- * @url /api/User/money_record
- * @method POST
- * @tag 基础
- * @header name:Authorization require:1 default: desc:验证token
- * @param name:page type:int require:0 default:1 desc:
- * @param name:limit type:int require:0 default:10 desc:
- *
- *
- *
- * @return name:paid type:int desc:是否完成0:审核中1:成功2:拒绝
- * @return name:withdraw_type type:string desc:方式(weixin:微信,zfb:支付宝,sy:订单收益)
- * @return name:create_at type:string desc:时间
- * @return name:price type:string desc:金额
- *
- */
- public function money_record(){
- $user_id = $this->check_login();
- $Nowpage = input('page',1);
- $limits = input("limit",10);
- $result = Users::moneyRecord($user_id,$Nowpage,$limits);
- $this->success($result['msg'],$result['data']);
- }
- /**
- * @title 用户端订单列表
- * @desc 用户端订单列表
- * @url /api/User/user_order_list
- * @method POST
- * @tag 基础
- * @header name:Authorization require:1 default: desc:验证token
- * @param name:page type:int require:0 default:1 desc:
- * @param name:limit type:int require:0 default:10 desc:
- * @param name:keywords type:int require:0 default:10 desc:关键词
- * @param name:status type:int require:0 default:10 desc:订单状态(-1:申请退款中-2:退款成功-3:退款失败0:待付款1:待服务;2:进行中;3:已完成,待评价;4:已评价5:取消订单all:全部订单)
- *
- *
- */
- public function user_order_list(){
- $user_id = $this->check_login();
- $Nowpage = input('page',1);
- $limits = input("limit",10);
- $status = input("status",'all');
- $keywords = input('keywords'); //搜索关键词
- $result = Users::userOrderList($user_id,$status,$keywords,$Nowpage,$limits);
- $this->success($result['msg'],$result['data']);
- }
- /**
- * @title 订单支付
- * @desc 订单支付
- * @url /api/User/pay_order
- * @method POST
- * @tag 基础
- * @header name:Authorization require:1 default: desc:验证token
- * @param name:order_no type:string require:0 default: desc:订单号
- *
- */
- public function pay_order(){
- $user_id = $this->check_login();
- $order_no = input('order_no'); //订单号
- if (!$order_no) $this->error('订单号为空');
- $result = Users::payOrder($user_id,$order_no);
- if ($result['code']){
- $this->success($result['msg'],$result['data']);
- }else{
- $this->error($result['msg']);
- }
- }
- /**
- * @title 订单支付加班费
- * @desc 订单支付加班费
- * @url /api/User/overtime_pay_order
- * @method POST
- * @tag 基础
- * @header name:Authorization require:1 default: desc:验证token
- * @param name:order_no type:string require:0 default: desc:订单号
- * @param name:pay_type type:string require:0 default: desc:支付方式(weixin:微信,zfb:支付宝)
- *
- */
- public function overtime_pay_order(){
- $user_id = $this->check_login();
- $order_no = input('order_no'); //订单号
- if (!$order_no) $this->error('订单号为空');
- $pay_type = input("pay_type",'weixin');
- if (!in_array($pay_type,array('weixin','zfb'))) $this->error('支付方式错误');
- $result = Users::overtimePayOrder($user_id,$order_no,$pay_type);
- if ($result['code']){
- $this->success($result['msg'],$result['data']);
- }else{
- $this->error($result['msg']);
- }
- }
- /**
- * @title 订单详情
- * @desc 订单详情
- * @url /api/User/order_detail
- * @method POST
- * @tag 基础
- * @header name:Authorization require:1 default: desc:验证token
- * @param name:order_no type:string require:0 default: desc:订单号
- *
- *
- */
- public function order_detail(){
- $this->check_login();
- $order_no= input('order_no'); //订单号
- $result = Users::orderDetail($order_no);
- if ($result['code']){
- $this->success($result['msg'],$result['data']);
- }else{
- $this->error($result['msg']);
- }
- }
- /**
- * @title 取消订单
- * @desc 取消订单
- * @url /api/User/cancel_order
- * @method POST
- * @tag 基础
- * @header name:Authorization require:1 default: desc:验证token
- * @param name:order_no type:string require:0 default: desc:订单号
- *
- *
- */
- public function cancel_order(){
- $user_id = $this->check_login();
- $order_no= input('order_no');
- $result = Users::cancelOrder($user_id,$order_no);
- if ($result['code']){
- $this->success($result['msg'],$result['data']);
- }else{
- $this->error($result['msg']);
- }
- }
- /**
- * @title 删除订单
- * @desc 删除订单
- * @url /api/User/del_order
- * @method POST
- * @tag 基础
- * @header name:Authorization require:1 default: desc:验证token
- * @param name:order_no type:string require:0 default: desc:订单号
- *
- *
- */
- public function del_order(){
- $user_id = $this->check_login();
- $order_no= input('order_no');
- $result = Users::delOrder($user_id,$order_no);
- if ($result['code']){
- $this->success($result['msg'],$result['data']);
- }else{
- $this->error($result['msg']);
- }
- }
- /**
- * @title 订单评价
- * @desc 订单评价
- * @url /api/User/evaluation_order
- * @method POST
- * @tag 基础
- * @header name:Authorization require:1 default: desc:验证token
- * @param name:order_no type:string require:0 default: desc:订单号
- * @param name:evaluation type:int require:0 default: desc:几颗星
- * @param name:evaluation_content type:string require:0 default: desc:评价内容
- *
- */
- public function evaluation_order(){
- $user_id = $this->check_login();
- $order_no= input('order_no'); //订单号
- $evaluation = intval(input('evaluation')); //几颗星
- $evaluation_content = input('evaluation_content'); //评价内容
- if (!$evaluation) $this->error('请评分');
- if ($evaluation<1 || $evaluation>5) $this->error('评分1-5');
- if (!$evaluation_content) $this->error('请输入评价内容');
- $result = Users::evaluationOrder($user_id,$order_no,$evaluation,$evaluation_content);
- if ($result['code']){
- $this->success($result['msg']);
- }else{
- $this->error($result['msg']);
- }
- }
- /**
- * @title 用户端我的评价
- * @desc 用户端我的评价
- * @url /api/User/user_evaluation_list
- * @method POST
- * @tag 基础
- * @header name:Authorization require:1 default: desc:验证token
- * @param name:page type:int require:0 default:1 desc:
- * @param name:limit type:int require:0 default:10 desc:
- *
- * @return name:order_no type:string desc:订单号
- * @return name:evaluation type:string desc:几颗星
- * @return name:evaluation_time type:string desc:时间
- * @return name:evaluation_content type:string desc:评价内容
- * @return name:name type:string desc:用户姓名
- * @return name:nickname type:string desc:用户昵称
- * @return name:headimg type:string desc:头像
- * @return name:designer_name type:string desc:设计师姓名
- */
- public function user_evaluation_list(){
- $user_id = $this->check_login();
- $Nowpage = input('page',1);
- $limits = input("limit",10);
- $result = Users::userEvaluationList($user_id,$Nowpage,$limits);
- $this->success($result['msg'],$result['data']);
- }
- /**
- * @title 设计师端我的评价
- * @desc 设计师端我的评价
- * @url /api/User/designer_evaluation_list
- * @method POST
- * @tag 基础
- * @header name:Authorization require:1 default: desc:验证token
- * @param name:page type:int require:0 default:1 desc:
- * @param name:limit type:int require:0 default:10 desc:
- *
- * @return name:order_no type:string desc:订单号
- * @return name:evaluation type:string desc:几颗星
- * @return name:evaluation_time type:string desc:时间
- * @return name:evaluation_content type:string desc:评价内容
- * @return name:name type:string desc:用户姓名
- * @return name:nickname type:string desc:用户昵称
- * @return name:headimg type:string desc:头像
- */
- public function designer_evaluation_list(){
- $user_id = $this->check_login();
- $Nowpage = input('page',1);
- $limits = input("limit",10);
- $result = Users::designerEvaluationList($user_id,$Nowpage,$limits);
- $this->success($result['msg'],$result['data']);
- }
- /**
- * @title 设计师端添加作品
- * @desc 设计师端添加作品
- * @url /api/User/add_works
- * @method POST
- * @tag 基础
- * @header name:Authorization require:1 default: desc:验证token
- * @param name:imgs type:array require:1 default: desc:作品图片,数组
- *
- */
- public function add_works(){
- $user_id = $this->check_login();
- $imgs = input('imgs'); //图片
- if (!$imgs) $this->error('请上传图片');
- $result = Users::addWorks($user_id,$imgs);
- if ($result['code']){
- $this->success($result['msg']);
- }else{
- $this->error($result['msg']);
- }
- }
- /**
- * @title 设计师端作品列表
- * @desc 设计师端作品列表
- * @url /api/User/work_list
- * @method POST
- * @tag 基础
- * @header name:Authorization require:1 default: desc:验证token
- *
- * @return name:date type:string desc:日期
- * @return name:imgs@id type:string desc:主键ID
- * @return name:imgs@img type:string desc:图片地址
- */
- public function work_list(){
- $user_id = $this->check_login();
- $result = Users::workList($user_id);
- $this->success($result['msg'],$result['data']);
- }
- /**
- * @title 设计师端删除作品
- * @desc 设计师端删除作品
- * @url /api/User/del_works
- * @method POST
- * @tag 基础
- * @header name:Authorization require:1 default: desc:验证token
- * @param name:ids type:string require:1 default: desc:作品id,多个以逗号隔开
- *
- */
- public function del_works(){
- $user_id = $this->check_login();
- $ids = input('ids'); //作品id
- if (!$ids) $this->error('作品id为空');
- $result = Users::delWorks($user_id,$ids);
- if ($result['code']){
- $this->success($result['msg']);
- }else{
- $this->error($result['msg']);
- }
- }
- /**
- * @title 设计师端订单列表
- * @desc 设计师端订单列表
- * @url /api/User/designer_order_list
- * @method POST
- * @tag 基础
- * @header name:Authorization require:1 default: desc:验证token
- *
- * @param name:page type:int require:0 default:1 desc:
- * @param name:limit type:int require:0 default:10 desc:
- * @param name:keywords type:int require:0 default:10 desc:关键词
- * @param name:status type:int require:0 default:10 desc:订单状态(1:已接单;2:待完成;3:已完成;all:全部订单)
- */
- public function designer_order_list(){
- $user_id = $this->check_login();
- $Nowpage = input('page',1);
- $limits = input("limit",10);
- $status = input("status",'all');
- $keywords = input('keywords'); //搜索关键词
- $result = Users::designerOrderList($user_id,$status,$keywords,$Nowpage,$limits);
- $this->success($result['msg'],$result['data']);
- }
- /**
- * @title 设计师开始工作打卡
- * @desc 设计师开始工作打卡
- * @url /api/User/clock_in_start
- * @method POST
- * @tag 基础
- * @header name:Authorization require:1 default: desc:验证token
- *
- * @param name:order_no type:string require:1 default: desc:订单号
- * @param name:start_address type:string require:0 default:10 desc:打卡地址
- */
- public function clock_in_start(){
- $user_id = $this->check_login();
- $order_no = input('order_no');
- $start_address = input('start_address');
- if (!$order_no || !$start_address) $this->error('参数错误');
- $result = Users::clockInStart($user_id,$order_no,$start_address);
- $this->success($result['msg'],$result['data']);
- }
- /**
- * @title 设计师结束工作打卡
- * @desc 设计师结束工作打卡
- * @url /api/User/clock_in_end
- * @method POST
- * @tag 基础
- * @header name:Authorization require:1 default: desc:验证token
- *
- * @param name:order_no type:string require:1 default: desc:订单号
- * @param name:end_address type:string require:0 default:10 desc:打卡地址
- */
- public function clock_in_end(){
- $user_id = $this->check_login();
- $order_no = input('order_no');
- $end_address = input('end_address');
- if (!$order_no || !$end_address) $this->error('参数错误');
- $result = Users::clockInEnd($user_id,$order_no,$end_address);
- $this->success($result['msg'],$result['data']);
- }
- /**
- * @title 设计师结束工作上传作品
- * @desc 设计师结束工作上传作品
- * @url /api/User/order_uploading
- * @method POST
- * @tag 基础
- * @header name:Authorization require:1 default: desc:验证token
- *
- * @param name:order_no type:string require:1 default: desc:订单号
- * @param name:works type:string require:0 default:10 desc:上传作品,数组
- */
- public function order_uploading(){
- $user_id = $this->check_login();
- $order_no = input('order_no');
- $works = input('works');
- if (!$order_no || !$works) $this->error('参数错误');
- $result = Users::orderUploading($user_id,$order_no,$works);
- $this->success($result['msg'],$result['data']);
- }
- /**
- * @title 用户优惠券列表
- * @desc 用户优惠券列表
- * @url /api/User/coupon_list
- * @method POST
- * @tag 基础
- * @header name:Authorization require:1 default: desc:验证token
- *
- * @param name:page type:int require:0 default:1 desc:
- * @param name:limit type:int require:0 default:10 desc:
- */
- public function coupon_list(){
- $user_id = $this->check_login();
- $Nowpage = input('page',1);
- $limits = input("limit",10);
- $result = Users::couponList($user_id,$Nowpage,$limits);
- $this->success($result['msg'],$result['data']);
- }
- }
|