123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656 |
- <?php
- namespace app\api\controller;
- use app\admin\model\Goods;
- use app\common\controller\Api;
- use app\common\library\Ems;
- use app\common\library\Sms;
- use app\common\library\Token;
- use app\common\model\Order;
- use app\common\model\OrderInvoice;
- use fast\Random;
- use think\Config;
- use think\Db;
- use think\Exception;
- use think\Hook;
- use think\Validate;
- /**
- * 会员接口
- */
- class User extends Api
- {
- protected $noNeedLogin = ['login', 'mobilelogin', 'register', 'resetpwd', 'changeemail', 'changemobile', 'third'];
- protected $noNeedRight = '*';
- public function _initialize()
- {
- parent::_initialize();
- if (!Config::get('fastadmin.usercenter')) {
- $this->error(__('User center already closed'));
- }
- }
- /**
- * 会员中心
- */
- public function index()
- {
- $this->auth->getUser()->head_img = config('site.head_img');
- $this->auth->getUser()->gw_name = config('site.gw_name');
- $this->auth->getUser()->dingding = config('site.dingding');
- $this->auth->getUser()->qywx = config('site.qywx');
- $this->success('', ['welcome' => $this->auth->getUser()]);
- }
- /**
- * 会员登录
- *
- * @ApiMethod (POST)
- * @param string $account 账号
- * @param string $password 密码
- */
- public function login()
- {
- $account = $this->request->post('account');
- $password = $this->request->post('password');
- if (!$account || !$password) {
- $this->error(__('Invalid parameters'));
- }
- $ret = $this->auth->login($account, $password);
- if ($ret) {
- $data = ['userinfo' => $this->auth->getUserinfo()];
- $this->success(__('Logged in successful'), $data);
- } else {
- $this->error($this->auth->getError());
- }
- }
- /**
- * 手机验证码登录
- *
- * @ApiMethod (POST)
- * @param string $mobile 手机号
- * @param string $captcha 验证码
- */
- public function mobilelogin()
- {
- $mobile = $this->request->post('mobile');
- $captcha = $this->request->post('captcha');
- // if (!$mobile || !$captcha) {
- // $this->error(__('Invalid parameters'));
- // }
- if (!Validate::regex($mobile, "^1\d{10}$")) {
- $this->error(__('Mobile is incorrect'));
- }
- // if (!Sms::check($mobile, $captcha, 'mobilelogin')) {
- // $this->error(__('Captcha is incorrect'));
- // }
- $user = \app\common\model\User::getByMobile($mobile);
- if ($user) {
- if ($user->status != 'normal') {
- $this->error(__('Account is locked'));
- }
- //如果已经有账号则直接登录
- $ret = $this->auth->direct($user->id);
- } else {
- $ret = $this->auth->register($mobile, Random::alnum(), '', $mobile, []);
- }
- if ($ret) {
- Sms::flush($mobile, 'mobilelogin');
- $data = ['userinfo' => $this->auth->getUserinfo()];
- $this->success(__('Logged in successful'), $data);
- } else {
- $this->error($this->auth->getError());
- }
- }
- /**
- * 注册会员
- *
- * @ApiMethod (POST)
- * @param string $username 用户名
- * @param string $password 密码
- * @param string $mobile 手机号
- * @param string $code 验证码
- */
- public function register()
- {
- $username = $this->request->post('username');
- $password = $this->request->post('password');
- // $email = $this->request->post('email');
- $mobile = $this->request->post('mobile');
- $code = $this->request->post('code');
- if (!$username) {
- $this->error(__('Invalid parameters'));
- }
- // if ($email && !Validate::is($email, "email")) {
- // $this->error(__('Email is incorrect'));
- // }
- if ($mobile && !Validate::regex($mobile, "^1\d{10}$")) {
- $this->error(__('Mobile is incorrect'));
- }
- // $ret = Sms::check($mobile, $code, 'register');
- // if ($ret != 8888) {
- // $this->error(__('Captcha is incorrect'));
- // }
- $ret = $this->auth->register($username, $mobile, $password,[]);
- if ($ret) {
- $data = ['userinfo' => $this->auth->getUserinfo()];
- $this->success(__('Sign up successful'), $data);
- } else {
- $this->error($this->auth->getError());
- }
- }
- /**
- * 退出登录
- * @ApiMethod (POST)
- */
- public function logout()
- {
- if (!$this->request->isPost()) {
- $this->error(__('Invalid parameters'));
- }
- $this->auth->logout();
- $this->success(__('Logout successful'));
- }
- /**
- * 修改会员个人信息
- *
- * @ApiMethod (POST)
- * @param string $avatar 头像地址
- * @param string $username 用户名
- * @param string $nickname 昵称
- * @param string $bio 个人简介
- * @param string $company 公司
- * @param string $company_site 公司地址
- */
- public function profile()
- {
- $user = $this->auth->getUser();
- $username = $this->request->post('username');
- $nickname = $this->request->post('nickname');
- $bio = $this->request->post('bio');
- $company = $this->request->post('company');
- $company_site = $this->request->post('company_site');
- $avatar = $this->request->post('avatar', '', 'trim,strip_tags,htmlspecialchars');
- if($avatar){
- $user->avatar = $avatar;
- }
- if ($username) {
- $exists = \app\common\model\User::where('username', $username)->where('id', '<>', $this->auth->id)->find();
- if ($exists) {
- $this->error(__('Username already exists'));
- }
- $user->username = $username;
- }
- if ($nickname) {
- $exists = \app\common\model\User::where('nickname', $nickname)->where('id', '<>', $this->auth->id)->find();
- if ($exists) {
- $this->error(__('Nickname already exists'));
- }
- $user->nickname = $nickname;
- }
- $user->bio = $bio;
- $user->company = $company;
- $user->company_site = $company_site;
- $user->save();
- $this->success();
- }
- /**
- * 修改邮箱
- *
- * @ApiMethod (POST)
- * @param string $email 邮箱
- * @param string $captcha 验证码
- */
- public function changeemail()
- {
- $user = $this->auth->getUser();
- $email = $this->request->post('email');
- $captcha = $this->request->post('captcha');
- if (!$email || !$captcha) {
- $this->error(__('Invalid parameters'));
- }
- if (!Validate::is($email, "email")) {
- $this->error(__('Email is incorrect'));
- }
- if (\app\common\model\User::where('email', $email)->where('id', '<>', $user->id)->find()) {
- $this->error(__('Email already exists'));
- }
- $result = Ems::check($email, $captcha, 'changeemail');
- if (!$result) {
- $this->error(__('Captcha is incorrect'));
- }
- $verification = $user->verification;
- $verification->email = 1;
- $user->verification = $verification;
- $user->email = $email;
- $user->save();
- Ems::flush($email, 'changeemail');
- $this->success();
- }
- /**
- * 修改手机号
- *
- * @ApiMethod (POST)
- * @param string $mobile 手机号
- * @param string $captcha 验证码
- */
- public function changemobile()
- {
- $user = $this->auth->getUser();
- $mobile = $this->request->post('mobile');
- $captcha = $this->request->post('captcha');
- if (!$mobile || !$captcha) {
- $this->error(__('Invalid parameters'));
- }
- if (!Validate::regex($mobile, "^1\d{10}$")) {
- $this->error(__('Mobile is incorrect'));
- }
- if (\app\common\model\User::where('mobile', $mobile)->where('id', '<>', $user->id)->find()) {
- $this->error(__('Mobile already exists'));
- }
- $result = Sms::check($mobile, $captcha, 'changemobile');
- if (!$result) {
- $this->error(__('Captcha is incorrect'));
- }
- $verification = $user->verification;
- $verification->mobile = 1;
- $user->verification = $verification;
- $user->mobile = $mobile;
- $user->save();
- Sms::flush($mobile, 'changemobile');
- $this->success();
- }
- /**
- * 第三方登录
- *
- * @ApiMethod (POST)
- * @param string $platform 平台名称
- * @param string $code Code码
- */
- public function third()
- {
- $url = url('user/index');
- $platform = $this->request->post("platform");
- $code = $this->request->post("code");
- $config = get_addon_config('third');
- if (!$config || !isset($config[$platform])) {
- $this->error(__('Invalid parameters'));
- }
- $app = new \addons\third\library\Application($config);
- //通过code换access_token和绑定会员
- $result = $app->{$platform}->getUserInfo(['code' => $code]);
- if ($result) {
- $loginret = \addons\third\library\Service::connect($platform, $result);
- if ($loginret) {
- $data = [
- 'userinfo' => $this->auth->getUserinfo(),
- 'thirdinfo' => $result
- ];
- $this->success(__('Logged in successful'), $data);
- }
- }
- $this->error(__('Operation failed'), $url);
- }
- /**
- * 重置密码
- *
- * @ApiMethod (POST)
- * @param string $mobile 手机号
- * @param string $newpassword 新密码
- * @param string $captcha 验证码
- */
- public function resetpwd()
- {
- $type = $this->request->post("type");
- $mobile = $this->request->post("mobile");
- $email = $this->request->post("email");
- $newpassword = $this->request->post("newpassword");
- $captcha = $this->request->post("captcha");
- if (!$newpassword || !$captcha) {
- $this->error(__('Invalid parameters'));
- }
- //验证Token
- if (!Validate::make()->check(['newpassword' => $newpassword], ['newpassword' => 'require|regex:\S{6,30}'])) {
- $this->error(__('Password must be 6 to 30 characters'));
- }
- // if ($type == 'mobile') {
- if (!Validate::regex($mobile, "^1\d{10}$")) {
- $this->error(__('Mobile is incorrect'));
- }
- $user = \app\common\model\User::getByMobile($mobile);
- if (!$user) {
- $this->error(__('User not found'));
- }
- // $ret = Sms::check($mobile, $captcha, 'resetpwd');
- // if (!$ret) {
- // $this->error(__('Captcha is incorrect'));
- // }
- // Sms::flush($mobile, 'resetpwd');
- // } else {
- // if (!Validate::is($email, "email")) {
- // $this->error(__('Email is incorrect'));
- // }
- // $user = \app\common\model\User::getByEmail($email);
- // if (!$user) {
- // $this->error(__('User not found'));
- // }
- // $ret = Ems::check($email, $captcha, 'resetpwd');
- // if (!$ret) {
- // $this->error(__('Captcha is incorrect'));
- // }
- // Ems::flush($email, 'resetpwd');
- // }
- //模拟一次登录
- $this->auth->direct($user->id);
- $ret = $this->auth->changepwd($newpassword, '', true);
- if ($ret) {
- $this->success(__('Reset password successful'));
- } else {
- $this->error($this->auth->getError());
- }
- }
- /**
- * 修改密码
- *
- * @ApiMethod (POST)
- * @param string $formerpassword 手机号
- * @param string $newpassword 新密码
- * @param string $newpassword_verify 确认密码
- */
- public function change_pwd()
- {
- $type = $this->request->post("type");
- $mobile = $this->request->post("mobile");
- $email = $this->request->post("email");
- $formerpassword = $this->request->post("formerpassword");
- $newpassword = $this->request->post("newpassword");
- $newpassword_verify = $this->request->post("newpassword_verify");
- $captcha = $this->request->post("captcha");
- if (!$formerpassword || !$newpassword || !$newpassword_verify) {
- $this->error('参数缺失');
- }
- if($newpassword != $newpassword_verify){
- $this->error('新密码不一致');
- }
- //验证Token
- if (!Validate::make()->check(['newpassword' => $newpassword], ['newpassword' => 'require|regex:\S{6,30}'])) {
- $this->error(__('Password must be 6 to 30 characters'));
- }
- // if ($type == 'mobile') {
- // if (!Validate::regex($mobile, "^1\d{10}$")) {
- // $this->error(__('Mobile is incorrect'));
- // }
- $user = \app\common\model\User::getByMobile($this->auth->mobile);
- if (!$user) {
- $this->error(__('User not found'));
- }
- if($this->auth->getEncryptPassword($formerpassword,$user->salt) != $user->password){
- $this->error('旧密码错误');
- }
- // $ret = Sms::check($mobile, $captcha, 'resetpwd');
- // if (!$ret) {
- // $this->error(__('Captcha is incorrect'));
- // }
- // Sms::flush($mobile, 'resetpwd');
- // } else {
- // if (!Validate::is($email, "email")) {
- // $this->error(__('Email is incorrect'));
- // }
- // $user = \app\common\model\User::getByEmail($email);
- // if (!$user) {
- // $this->error(__('User not found'));
- // }
- // $ret = Ems::check($email, $captcha, 'resetpwd');
- // if (!$ret) {
- // $this->error(__('Captcha is incorrect'));
- // }
- // Ems::flush($email, 'resetpwd');
- // }
- //模拟一次登录
- $this->auth->direct($user->id);
- $ret = $this->auth->changepwd($newpassword, '', true);
- if ($ret) {
- $this->success(__('Reset password successful'));
- } else {
- $this->error($this->auth->getError());
- }
- }
- /**
- * 注销用户
- */
- public function cancellation(){
- if (\app\common\model\User::update(['status'=>'lock'],['id'=>$this->auth->id])){
- $this->auth->logout();
- $this->success('注销成功');
- }
- $this->error('注销失败');
- }
- /**
- * 我的订单列表
- * @ApiMethod (POST)
- * @ApiReturnParams (name="uid",description="用户id")
- * @ApiReturnParams (name="type",description="订单类型 1订单 2报价单")
- * @ApiReturnParams (name="customization",description="定制金额")
- * @ApiReturnParams (name="goods_id",description="商品id")
- * @ApiReturnParams (name="goods_name",description="商品名称")
- * @ApiReturnParams (name="order_no",description="订单编号")
- * @ApiReturnParams (name="amount_real",description="订单金额")
- * @ApiReturnParams (name="status",description="订单流程状态(0已取消,1待支付,2已支付)")
- * @ApiReturnParams (name="create_time",description="创建时间")
- * @ApiReturnParams (name="deploy_type",description="部署方式0自己部署 1授权部署")
- * @ApiReturnParams (name="deploy",description="授权部署信息")
- * @ApiReturnParams (name="billing_status",description="开票状态 0未开票1已开票")
- * @ApiReturnParams (name="valid_time",description="报价单失效时间")
- */
- public function myorder(){
- $list = Order::all(function ($query){
- $query->where(['uid'=>$this->auth->id,'type'=>1])->field('id,uid,type,goods_id,goods_name,order_no,amount_real,status,create_time,deploy_type,deploy,billing_status')->order('id desc');
- });
- $bjlist = Order::all(function ($query){
- $query->where(['uid'=>$this->auth->id,'type'=>2,'status'=>2])->order('id desc');
- });
- $res = array_merge($list,$bjlist);
- $this->success('请求成功',$res);
- }
- /**
- * 我的订单详情
- * @ApiMethod (POST)
- * @ApiParams (name="id",description="订单id")
- * @ApiReturnParams (name="uid",description="用户id")
- * @ApiReturnParams (name="type",description="订单类型 1订单 2报价单")
- * @ApiReturnParams (name="customization",description="定制金额")
- * @ApiReturnParams (name="goods_id",description="商品id")
- * @ApiReturnParams (name="goods_name",description="商品名称")
- * @ApiReturnParams (name="order_no",description="订单编号")
- * @ApiReturnParams (name="amount_real",description="订单金额")
- * @ApiReturnParams (name="status",description="订单流程状态(0已取消,1待支付,2已支付)")
- * @ApiReturnParams (name="create_time",description="创建时间")
- * @ApiReturnParams (name="deploy_type",description="部署方式0自己部署 1授权部署")
- * @ApiReturnParams (name="deploy",description="授权部署信息")
- * @ApiReturnParams (name="billing_status",description="开票状态 0未开票1已开票")
- * @ApiReturnParams (name="valid_time",description="报价单失效时间")
- */
- public function myorder_details(){
- $list = Order::get(function ($query){
- $query->where(['uid'=>$this->auth->id,'type'=>1,'id'=>input('id')])->field('id,uid,type,goods_id,goods_name,order_no,amount_real,status,create_time,deploy_type,deploy,billing_status,after_sale')->order('id desc');
- });
- $this->success('请求成功',$list);
- }
- /**
- * 我的报价单列表
- * @ApiMethod (POST)
- * @ApiReturnParams (name="uid",description="用户id")
- * @ApiReturnParams (name="type",description="订单类型 1订单 2报价单")
- * @ApiReturnParams (name="customization",description="定制金额")
- * @ApiReturnParams (name="goods_id",description="商品id")
- * @ApiReturnParams (name="goods_name",description="商品名称")
- * @ApiReturnParams (name="order_no",description="订单编号")
- * @ApiReturnParams (name="amount_real",description="订单金额")
- * @ApiReturnParams (name="market",description="报价人")
- * @ApiReturnParams (name="status",description="订单流程状态(0已取消,1待支付,2已支付)")
- * @ApiReturnParams (name="create_time",description="创建时间")
- * @ApiReturnParams (name="deploy_type",description="部署方式0自己部署 1授权部署")
- * @ApiReturnParams (name="deploy",description="授权部署信息")
- * @ApiReturnParams (name="billing_status",description="开票状态 0未开票1已开票")
- * @ApiReturnParams (name="valid_time",description="报价单失效时间")
- */
- public function mypjorder(){
- $list = Order::all(function ($query){
- $query->where(['uid'=>$this->auth->id,'type'=>2])->where('status','<>',2)->field('id,uid,type,goods_id,goods_name,order_no,amount_real,market,status,create_time,deploy_type,deploy,billing_status,valid_time')->order('id desc');
- });
- // foreach ($list as $v){
- // $v['user'] = \app\admin\model\User::field('username,mobile,postcode,email,company,company_site')->find(['id'=>$v['uid']]);
- // }
- $this->success('请求成功',$list);
- }
- /**
- * 我的报价单详情
- * @ApiMethod (POST)
- * @ApiParams (name="id",description="订单id")
- * @ApiReturnParams (name="uid",description="用户id")
- * @ApiReturnParams (name="type",description="订单类型 1订单 2报价单")
- * @ApiReturnParams (name="customization",description="定制金额")
- * @ApiReturnParams (name="goods_id",description="商品id")
- * @ApiReturnParams (name="goods_name",description="商品名称")
- * @ApiReturnParams (name="order_no",description="订单编号")
- * @ApiReturnParams (name="amount_real",description="订单金额")
- * @ApiReturnParams (name="market",description="报价人")
- * @ApiReturnParams (name="status",description="订单流程状态(0已取消,1待支付,2已支付)")
- * @ApiReturnParams (name="create_time",description="创建时间")
- * @ApiReturnParams (name="deploy_type",description="部署方式0自己部署 1授权部署")
- * @ApiReturnParams (name="deploy",description="授权部署信息")
- * @ApiReturnParams (name="billing_status",description="开票状态 0未开票1已开票")
- * @ApiReturnParams (name="valid_time",description="报价单失效时间")
- */
- public function mypjorder_details(){
- $list = Order::get(function ($query){
- $query->where(['uid'=>$this->auth->id,'type'=>2,'id'=>input('id')])->field('id,uid,type,goods_id,goods_name,order_no,amount_real,market,status,create_time,deploy_type,deploy,billing_status,valid_time,customization')->order('id desc');
- });
- $list['price'] = Goods::where('id',$list['goods_id'])->value('price');
- $list['user'] = \app\admin\model\User::field('username,mobile,postcode,email,company,company_site')->find(['id'=>$list['uid']]);
- $this->success('请求成功',$list);
- }
- /**
- * 申请开票
- * @ApiMethod ("POST")
- * @ApiParams (name="cp_order_no",description="订单编号")
- * @ApiParams (name="invoice_type",description="发票类型 1普通发票2增值税发票")
- * @ApiParams (name="invoice_shape",description="发票形式 1纸质发票2电子发票")
- * @ApiParams (name="type",description="类型 1个人2企业")
- * @ApiParams (name="name",description="抬头名称")
- * @ApiParams (name="duty_paragraph",description="单位税号")
- * @ApiParams (name="address",description="注册地址")
- * @ApiParams (name="company_phone",description="公司电话")
- * @ApiParams (name="bank",description="银行")
- * @ApiParams (name="compellation",description="姓名")
- * @ApiParams (name="phone",description="个人电话")
- * @ApiParams (name="location",description="所在地")
- * @ApiParams (name="postcode",description="邮编")
- * @ApiParams (name="emial",description="邮箱")
- */
- public function make_ticket(){
- $uid = $this->auth->id;
- if(input('type')==1) {
- $rule = [
- 'cp_order_no'=>'require',
- 'invoice_type'=>'require',
- 'invoice_shape'=>'require',
- 'type'=>'require',
- 'name'=>'require',
- 'compellation'=>'require',
- 'phone'=>'require',
- 'location'=>'require',
- 'postcode'=>'require',
- 'emial'=>'require',
- ];
- }else if(input('type')==2){
- $rule = [
- 'cp_order_no'=>'require',
- 'invoice_type'=>'require',
- 'invoice_shape'=>'require',
- 'type'=>'require',
- 'name'=>'require',
- 'duty_paragraph'=>'require',
- 'address'=>'require',
- 'company_phone'=>'require',
- 'bank'=>'require',
- 'compellation'=>'require',
- 'phone'=>'require',
- 'location'=>'require',
- ];
- }
- $data = $this->_validate($rule);
- $data['uid'] = $uid;
- $data['order_no'] = pay_no($uid);
- if(!empty(Order::where('order_no', $data['cp_order_no'])->value('billing_status'))){
- $this->error('订单已申请发票');
- }
- DB::startTrans();
- try {
- $OrderInvoice = OrderInvoice::create($data);
- Order::where('order_no', $data['cp_order_no'])->update(['billing_status' => 1]);
- Db::commit();
- $this->success('申请成功',$OrderInvoice);
- }catch (Exception $exception){
- DB::rollback();
- $this->error($exception);
- return false;
- }
- }
- /**
- * 发票列表
- * @ApiMethod ("POST")
- * @ApiReturnParams (name="cp_order_no",description="产品订单编号")
- * @ApiReturnParams (name="order_no",description="订单编号")
- * @ApiReturnParams (name="invoice_type",description="发票类型 1普通发票2增值税发票")
- * @ApiReturnParams (name="invoice_shape",description="发票形式 1纸质发票2电子发票")
- * @ApiReturnParams (name="type",description="类型 1个人2企业")
- * @ApiReturnParams (name="name",description="抬头名称")
- * @ApiReturnParams (name="duty_paragraph",description="单位税号")
- * @ApiReturnParams (name="address",description="注册地址")
- * @ApiReturnParams (name="company_phone",description="公司电话")
- * @ApiReturnParams (name="bank",description="银行")
- * @ApiReturnParams (name="compellation",description="姓名")
- * @ApiReturnParams (name="phone",description="个人电话")
- * @ApiReturnParams (name="location",description="所在地")
- * @ApiReturnParams (name="postcode",description="邮编")
- * @ApiReturnParams (name="emial",description="邮箱")
- * @ApiReturnParams (name="apply_time",description="申请时间")
- * @ApiReturnParams (name="status",description="开票状态1待开票2已寄出3已完成")
- */
- public function invoice_list(){
- $data = OrderInvoice::all(function ($query){
- $query->where('uid',$this->auth->id);
- });
- foreach ($data as $v){
- $v['order'] = Order::where('order_no',$v['cp_order_no'])->field('create_time,goods_name,amount_real,deploy_type,deploy')->find();
- }
- $this->success('请求成功',$data);
- }
- /**
- * 发票确认收货
- * @ApiParams (name="id")
- */
- public function invoice_receive(){
- $res = OrderInvoice::where('id',input('id'))->update(['status'=>3]);
- if ($res){
- $this->success('收货成功');
- }
- }
- }
|