Doctor.php 23.6 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640
<?php

namespace app\api\controller;

use app\api\model\Appointment;
use app\api\model\AppointmentAppraise;
use app\api\model\DoctorMoneyLog;
use app\api\model\DoctorNowork;
use app\api\model\Withdraw;
use app\common\controller\Api;
use app\api\model\Doctor as DoctorModel;
use app\common\controller\Tim;
use app\common\controller\Wechat;
use think\Db;
use think\Exception;
use think\exception\PDOException;

/**
 * 医生端接口
 */
class Doctor extends Api
{
    protected $noNeedLogin = ['*'];
    protected $noNeedRight = ['*'];
    protected $id = 0;

    public function _initialize()
    {
        parent::_initialize();
        //检测是否登录
        if (!$this->auth->isLogin()) {
            $this->error(__('Please login first'), null, 401);
        }
        $doctor = DoctorModel::where('user_id',$this->auth->id)->field('id')->find();
        empty($doctor) && $this->error('您还不是医生');
        $this->id = $doctor['id'];
    }

    /**
     * @ApiWeigh    (99)
     * @ApiTitle    (订单-首页)
     * @ApiSummary  (订单-首页)
     * @ApiMethod   (POST)
     * @ApiHeaders  (name="token", type="string", required=true, description="token")
     * @ApiReturn({
        "code": 1,
        "msg": "成功",
        "time": "1622016289",
        "data": {
            "count1": 8,//待完成数量
            "count2": 1,//已完成数量
        }
    })
     */
    public function appointment(){
        $count1 = Appointment::where('doctor_id',$this->id)->where('status','in','1,2')->count();
        $count2 = Appointment::where('doctor_id',$this->id)->where('status','in','3')->count();
        $this->success('成功',compact('count1','count2'));
    }

    /**
     * @ApiWeigh    (97)
     * @ApiTitle    (订单-列表)
     * @ApiSummary  (订单-列表)
     * @ApiMethod   (POST)
     * @ApiHeaders  (name="token", type="string", required=true, description="token")
     * @ApiParams   (name=status, type=integer, required=true, description="状态:1=待完成,2=已完成")
     * @ApiReturn({
        "code": 1,
        "msg": "成功",
        "time": "1625585459",
        "data": {
            "total": 1, //数据总数
            "per_page": 10,
            "current_page": 1,
            "last_page": 1,
            "data": [{ //列表
                "id": 1, //预约ID
                "date": "2021-07-06", //预约日期
                "type": "1", //服务类型:1=文字沟通,2=语音沟通
                "description": "", //症状描述
                "status": "3", //状态:1=未开始,2=诊断中,3=已完成
                "diagnose_time": { //诊断时间
                    "hours": 0, //时
                    "minutes": 0, //分
                    "seconds": 39 //秒
                },
                "user": { //用户信息
                    "id": 1, //用户ID
                    "nickname": "何先生", //昵称
                    "avatar": "https://consultation.brofirst.cn/uploads/20201225/37520d1204a0c55474021b43dac2a69e.png" //头像
                },
                "dept_list": [{ //专科列表
                    "id": 1, //ID
                    "name": "骨科与神经外科" //名称
                }]
            }]
        }
    })
     */
    public function appointmentList(){
        $status = $this->request->post('status');
        empty($status) && $this->error('缺少必需参数');
        $where['doctor_id'] = $this->id;
        if($status == 1){
            $where['status'] = ['in','1,2'];
        }else{
            $where['status'] = '3';
        }
        $list = Appointment::with(['user'])
            ->where($where)
            ->paginate(10)
            ->each(function ($v){
                $v->visible(['id','date','type','status','diagnose_time','description','user'])->append(['dept_list']);
                $v->getRelation('user')->visible(['id','nickname','avatar']);
            });
        $this->success('成功',$list);
    }

    /**
     * @ApiWeigh    (95)
     * @ApiTitle    (订单-详情)
     * @ApiSummary  (订单-详情)
     * @ApiMethod   (POST)
     * @ApiHeaders  (name="token", type="string", required=true, description="token")
     * @ApiParams   (name=appointment_id, type=integer, required=true, description="预约ID")
     * @ApiReturn({
        "code": 1,
        "msg": "成功",
        "time": "1625563325",
        "data": {
            "id": 1, //预约ID
            "date": "2021-07-06", //服务时间
            "type": "1", //服务类型:1=文字沟通,1=音频沟通
            "description": "", //病状描述
            "status": "1", //状态:1=未开始,2=诊断中,3=已完成
            "diagnose_time": { //诊断时间
                "hours": 0, //时
                "minutes": 0, //分
                "seconds": 39 //秒
            },
            "user": { //医生信息
                "id": 1, //ID
                "nickname": "小何", //姓名
                "avatar": "http://www.consultation.top/assets/img/qrcode.png", //头像
            },
            "appraise": {
                "id": 1, //ID
                "star": 3, //评分
                "content": "这就是街舞", //评论内容
                "images": [ //图片
                    "http://www.consultation.top/uploads/20210623/32a69f0cb6c609b1d55f56f17583c473.png"
                ],
                "video": "", //视频地址
                "video_cover": "", //视频封面
                "reply": "", //回复内容
                "createtime": "2021-07/06-17:37", //评论时间
                "star_level_text": "中" //评分文字
            },
            "dept_list": [{ //专科列表
                "id": 1, //ID
                "name": "骨科与神经外科" //名称
            }]
        }
    })
     */
    public function appointmentInfo(){
        $appointment_id = $this->request->post('appointment_id');
        empty($appointment_id) && $this->error('缺少必需参数');
        $appointment = Appointment::with(['user','appraise'])->where('id',$appointment_id)->find();
        empty($appointment) && $this->error('预约不存在');
        $appointment->visible(['id','date','type','status','diagnose_time','description','user','appraise'])->append(['dept_list']);
        // 用户信息
        if($appointment->getRelation('user')){
            $appointment->getRelation('user')->visible(['id','nickname','avatar']);
        }else{
            $appointment['user'] = (Object)[];
        }
        // 评价信息
        if($appointment->getRelation('appraise')){
            $appointment->getRelation('appraise')->visible(['id','star','content','video','video_cover','images','reply','createtime']);
        }else{
            $appointment['appraise'] = (Object)[];
        }
        $this->success('成功',$appointment);
    }

    /**
     * @ApiWeigh    (93)
     * @ApiTitle    (预约-在线咨询)
     * @ApiSummary  (预约-在线咨询)
     * @ApiMethod   (POST)
     * @ApiHeaders  (name=token, type=string, required=true, description="请求的Token")
     * @ApiParams   (name=appointment_id, type=integer, required=true, description="预约ID")
     * @ApiReturn({
        "code": 1,
        "msg": "成功",
        "time": "1604282876",
        "data": null
    })
     */
    public function appointmentDiagnose(){
        $appointment_id = $this->request->post('appointment_id');
        empty($appointment_id) && $this->error('缺少必需参数');
        $appointment = Appointment::get(['doctor_id'=>$this->id,'id'=>$appointment_id]);
        empty($appointment) && $this->error('预约不存在');
        !in_array($appointment['status'],['1,2']) && $this->error('订单不合法');
        if($appointment['status'] == '1'){
            $tim = new Tim();
            // 导入用户
            if(!$res = $tim->importUser($appointment['user'])){
                $this->error($tim->getError());
            }
            // 导入医生
            if(!$res = $tim->importUser($appointment['doctor'])){
                $this->error($tim->getError());
            }
            // 发送消息
            if(!$res = $tim->sendMsg('doctor_'.$appointment['doctor_id'],'user_'.$appointment['user_id'],'服务开始,请问有什么可以帮助您的?')){
                $this->error($tim->getError());
            }
            $appointment->save(['status'=>'2','diagnose_time'=>time()]);
        }
        $this->success('成功');
    }

    /**
     * @ApiWeigh    (91)
     * @ApiTitle    (预约-确认完成)
     * @ApiSummary  (预约-确认完成)
     * @ApiMethod   (POST)
     * @ApiHeaders  (name="token", type="string", required=true, description="token")
     * @ApiParams   (name=appointment_id, type=string, required=true, description="预约ID")
     * @ApiReturn({
        "code": 1,
        "msg": "成功",
        "time": "1622016289",
        "data": null
    })
     */
    public function appointmentConfirm(){
        $appointment_id = $this->request->post('appointment_id');
        empty($appointment_id) && $this->error('缺少必需参数');
        $appointment = Appointment::get(['doctor_id'=>$this->id,'id'=>$appointment_id]);
        (new User)->confirm($appointment);
        $this->success('成功');
    }

    /**
     * @ApiWeigh (89)
     * @ApiTitle    (个人信息)
     * @ApiSummary  (个人信息)
     * @ApiMethod   (POST)
     * @ApiHeaders  (name="token", type="string", required=true, description="token ")
     * @ApiReturn   ({
        "code": 1,
        "msg": "成功",
        "time": "1625584032",
        "data": {
            "id": 1, //医生ID
            "nickname": "小何", //姓名
            "avatar": "https://consultation.brofirst.cn/assets/img/qrcode.png", //头像
            "level_id": 2,
            "good_field": "爬树", //擅长
            "description": "爬树小王子", //简介
            "money": "0.00", //余额
            "star": "3.00", //评分
            "images": [ //图片
              "https://consultation.brofirst.cn/assets/img/qrcode.png",
              "https://consultation.brofirst.cn/assets/img/qrcode.png"
            ],
            "level": 2 //医生等级
        }
    })
     */
    public function doctorInfo()
    {
        $data = DoctorModel::where('id',$this->id)
            ->field('id,nickname,avatar,level_id,good_field,description,money,star,images')
            ->find();
        $data->append(['level']);
        $this->success('成功', $data);
    }

    /**
     * @ApiWeigh (87)
     * @ApiTitle    (修改信息)
     * @ApiSummary  (修改信息)
     * @ApiMethod   (POST)
     * @ApiHeaders  (name="token", type="string", required=true, description="token")
     * @ApiParams  (name="avatar", type="string", required=false, description="头像地址")
     * @ApiParams  (name="nickname", type="string", required=false, description="姓名")
     * @ApiParams  (name="good_field", type="string", required=false, description="擅长")
     * @ApiParams  (name="description", type="string", required=false, description="简介")
     * @ApiParams  (name="images", type="string", required=false, description="图片组")
     * @ApiReturn   ({
        "code": 1,
        "msg": "",
        "time": "1620711606",
        "data": null
    })
     */
    public function profile()
    {
        $data = $this->request->post();
        $data = array_filter($data); //过滤空数据
        !$data && $this->error('请填写修改内容');
        $doctor = DoctorModel::get($this->id);
        foreach($data as $k => $v){
            $doctor->{$k} = $v;
        }
        $doctor->save();
        $this->success('成功');
    }

    /**
     * @ApiWeigh    (85)
     * @ApiTitle    (我的收益)
     * @ApiSummary  (我的收益)
     * @ApiMethod   (POST)
     * @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
     * @ApiReturn({
        "code": 1,
        "msg": "成功",
        "time": "1604282876",
        "data": {
            "money" : 50, //账户余额
            "month_money": 50, //本月收入
            "total_money": 50 //累计收入
        }
    })
     */
    public function myMoney()
    {
        $doctor = DoctorModel::get($this->id);
        $this->success('成功',[
            'money' => $doctor['money'],
            'month_money' => DoctorMoneyLog::where('doctor_id',$this->id)->whereTime('createtime','m')->where('status','1')->sum('money'),
            'total_money' => DoctorMoneyLog::where('doctor_id',$this->id)->where('status','1')->sum('money'),
        ]);
    }

    /**
     * @ApiWeigh    (83)
     * @ApiTitle    (我的收益-明细)
     * @ApiSummary  (我的收益-明细)
     * @ApiMethod   (POST)
     * @ApiHeaders  (name=token, type=string, required=true, description="请求的Token")
     * @ApiReturn({
        "code": 1,
        "msg": "成功",
        "time": "1604639360",
        "data": {
            "total": 6, //数据总数
            "per_page": 15,
            "current_page": 1,
            "last_page": 1,
            "data": [{
                "id": 6, //记录ID
                "money": "3.50", //金额
                "memo": "订单完成", //备注
                "createtime": "11/06/13:06", //记录时间
                "status": "1", //状态:1=已到账,2=即将到账,3=提现成功
            }]
        }
    })
     */
    public function moneyList()
    {
        $data = DoctorMoneyLog::with(['appointment'])
            ->where('doctor_id',$this->id)
            ->order('createtime desc')
            ->paginate(10)
            ->each(function($v){
                // 格式化时间
                $v->createtime = date('m-d H:i',$v->createtime);
                $v->money = str_replace('-','',$v->money);
                if($v['status'] != '3'){
                    if(!empty($v['appointment']['dept_list'])){
                        $dept_names = array_column($v['appointment']['dept_list'], 'name');
                        !empty($dept_names) && $v->createtime = date('m-d ',$v->createtime) . implode(' ',$dept_names);
                    }
                }
                $v->visible(['id','money','createtime','memo','status']);
            });
        $this->success('成功',$data);
    }

    /**
     * @ApiWeigh    (81)
     * @ApiTitle    (提现)
     * @ApiSummary  (提现)
     * @ApiMethod   (POST)
     * @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
     * @ApiParams  (name="money", type="string", required=true, description="提现金额")
     * @ApiReturn({
        "code": 1,
        "msg": "成功",
        "time": "1604282876",
        "data": null
    })
     */
    public function withdraw()
    {
        $money = $this->request->post('money');
        empty($money) && $this->error('请输入金额');
        $money_reg = '/^[0-9]+(.[0-9]{1,2})?$/';
        !preg_match($money_reg, $money) && $this->error('金额格式错误');
        $money <= 0 && $this->error('提现金额不能小于0');
        $money > $this->auth->money && $this->error('余额不足'.$money.'元');

        // 禁止连点
        !empty(cache('withdraw_token'.$this->auth->id)) && $this->error('提现频繁,请稍后再试');
        cache('withdraw_token'.$this->auth->id,'123',5);

        Db::startTrans();
        try{
            $withdraw = Withdraw::create([
                'doctor_id' => $this->id,
                'order_sn' => get_order_sn(),
                'money' => $money,
            ]);
            // 变更医生余额
            DoctorModel::money(-$money,$this->id,'提现成功');

            // 发起企业付款
            $Wechat = new Wechat;
            $openid = Db::name('third')->where('user_id',$this->auth->id)->value('openid');
            if(!$balance = $Wechat->toBalance($withdraw['order_sn'], $openid, $withdraw['money'] * 100)){
                $this->error($Wechat->getError());
            }
            // 记录企业付款单号
            $withdraw->payment_no = $balance['payment_no'];
            $withdraw->payment_time = $balance['payment_time'];
            $withdraw->status = '1';
            $withdraw->save();

            Db::commit();
        } catch (PDOException $e) {
            Db::rollback();
            $this->error($e->getMessage());
        } catch (Exception $e) {
            Db::rollback();
            $this->error($e->getMessage());
        }
        $this->success('成功');
    }

    /**
     * @ApiWeigh    (79)
     * @ApiTitle    (预约时间)
     * @ApiSummary  (预约时间)
     * @ApiMethod   (POST)
     * @ApiReturn({
        "code": 1,
        "msg": "成功",
        "time": "1625586261",
        "data": [{
          "date": "2021-07-06", //日期
          "name": "今天", //日期文字
          "status": 1 //预约状态:1=待接诊,2=不接诊,3=已预约
        }]
    })
     */
    public function dateList(){
        $arr = [];
        for($i = 0; $i < 7; $i++){
            $day = time()+$i*86400;
            $date = date('Y-m-d',$day);
//            $tomorrow_time = strtotime('+1 days',strtotime($date));
            // 预约状态:1=待接诊,2=不接诊,3=已预约
            $nowork = DoctorNowork::where('doctor_id',$this->id)
                ->where('date',$date)
                ->find();
            $appointment = Appointment::where('doctor_id',$this->id)
                ->where('date',$date)
//                ->where('date_time','<',$tomorrow_time)
                ->where('status','in','1,2')
                ->find();
            $arr[] = [
                'date' => $date,
                'name' => $i == 0 ? '今天' : date('m月d日',$day),
                'status' => !empty($nowork) ? 2 : (!empty($appointment) ? 3 : 1),
            ];
        }
        $this->success('成功',$arr);
    }

    /**
     * @ApiWeigh (77)
     * @ApiTitle    (预约时间-不接诊)
     * @ApiSummary  (预约时间-不接诊)
     * @ApiMethod   (POST)
     * @ApiHeaders  (name="token", type="string", required=true, description="token")
     * @ApiParams  (name="date", type="string", required=true, description="日期", simple="2021-07-05")
     * @ApiReturn   ({
        "code": 1,
        "msg": "",
        "time": "1620711606",
        "data": null
    })
     */
    public function nowork()
    {
        $date = $this->request->post('date');
        empty($date) && $this->error('请选择预约时间');
        for($i = 0; $i < 7; $i++){
            $day = time()+$i*86400;
            $date_arr[] = date('Y-m-d',$day);
        }
        !in_array($date,$date_arr) && $this->error('预约时间不合法');
//        $tomorrow_time = strtotime('+1 days',strtotime($date));
        $appointment = Appointment::where('doctor_id',$this->id)
            ->where('date',$date)
//            ->where('date_time','<',$tomorrow_time)
            ->where('status','in','1,2')
            ->find();
        !empty($appointment) && $this->error('该时间段已经有预约了,无法设置不可被预约');
        $nowork = DoctorNowork::where('doctor_id',$this->id)->where('date',$date)->find();
        !empty($nowork) && $this->error('该时间段您已设置了无法预约,请勿重复操作');
        DoctorNowork::create([
            'doctor_id' => $this->id,
            'date' => $date,
        ]);
        $this->success('设置成功');
    }

    /**
     * @ApiWeigh    (75)
     * @ApiTitle    (我的评价)
     * @ApiSummary  (我的评价)
     * @ApiMethod   (POST)
     * @ApiHeaders  (name="token", type="string", required=true, description="token")
     * @ApiParams   (name="page", type="integer", required=false, description="分页")
     * @ApiReturn({
        "code": 1,
        "msg": "成功",
        "time": "1625620158",
        "data": {
            "total": 1, //数据总数
            "per_page": 10,
            "current_page": 1,
            "last_page": 1,
            "data": [{ //列表
                "id": 1, //ID
                "star": 3, //评分
                "content": "这就是街舞", //评价内容
                "images": [ //图片
                    "http://www.consultation.top/uploads/20210623/32a69f0cb6c609b1d55f56f17583c473.png"
                ],
                "video": "", //视频
                "video_cover": "", //视频封面
                "reply": "hh", //回复内容
                "createtime": "2021-07/06-17:37", //发布时间
                "user": { //用户信息
                    "id": 1, //ID
                    "nickname": "何先生", //昵称
                    "avatar": "http://www.consultation.top/uploads/20201225/37520d1204a0c55474021b43dac2a69e.png" //头像
                },
                "appointment": { //预约信息
                    "id": 1, //ID
                    "status": "3", //状态:1=未开始,2=诊断中,3=已完成
                    "dept_list": [{ //专科列表
                        "id": 1, //ID
                        "name": "骨科与神经外科" //名称
                    }]
                },
                "star_level_text": "中" //评分文字
            }]
        }
    })
     */
    public function appraiseList(){
        $data = AppointmentAppraise::with(['user','appointment'])
            ->where('doctor_id',$this->id)
            ->where('delete_status','neq','2')
            ->order('createtime desc')
            ->paginate(10)
            ->each(function($v) {
                $v->visible(['id','star','content','video','video_cover','images','reply','createtime','user','appointment']);
                // 用户信息
                $v->getRelation('user')->visible(['id','nickname','avatar']);
                // 预约信息
                $v->getRelation('appointment')->visible(['id','status'])->append(['dept_list']);
            });
        $this->success('成功', $data);
    }

    /**
     * @ApiWeigh    (73)
     * @ApiTitle    (我的评价-回复)
     * @ApiSummary  (我的评价-回复)
     * @ApiMethod   (POST)
     * @ApiHeaders  (name="token", type="string", required=true, description="token")
     * @ApiParams   (name="appraise_id", type="integer", required=true, description="评价ID")
     * @ApiParams   (name="reply", type="string", required=true, description="回复内容")
     * @ApiReturn({
        "code": 1,
        "msg": "成功",
        "time": "1624962649",
        "data": null
    })
     */
    public function appraiseReply(){
        $appraise_id = $this->request->post('appraise_id');
        $reply = $this->request->post('reply');
        empty($appraise_id) && $this->error('请选择评价');
        empty($reply) && $this->error('请填写回复内容');
        $appraise = AppointmentAppraise::get(['id'=>$appraise_id,'doctor_id'=>$this->id]);
        empty($appraise) && $this->error('评价信息不存在');
        !empty($appraise['reply']) && $this->error('已回复,请勿重复回复');
        $appraise->save(['reply' => $reply]);
        $this->success('成功');
    }

    /**
     * @ApiWeigh    (71)
     * @ApiTitle    (我的评价-申请删除)
     * @ApiSummary  (我的评价-申请删除)
     * @ApiMethod   (POST)
     * @ApiHeaders  (name="token", type="string", required=true, description="token")
     * @ApiParams   (name="appraise_id", type="integer", required=true, description="评价ID")
     * @ApiReturn({
        "code": 1,
        "msg": "成功",
        "time": "1624962649",
        "data": null
    })
     */
    public function appraiseDelete(){
        $appraise_id = $this->request->post('appraise_id');
        empty($appraise_id) && $this->error('请选择评价');
        $appraise = AppointmentAppraise::get(['id'=>$appraise_id,'doctor_id'=>$this->id]);
        empty($appraise) && $this->error('评价信息不存在');
        $appraise['delete_status'] == '1' && $this->error('已申请删除,请勿重复操作');
        $appraise['delete_status'] == '2' && $this->error('已删除');
        $appraise->save(['delete_status' => '1']);
        $this->success('成功');
    }
}