作者 lyh

gx

@@ -57,7 +57,7 @@ class Count extends Command @@ -57,7 +57,7 @@ class Count extends Command
57 //服务达标天数 57 //服务达标天数
58 $arr['compliance_day'] = $this->compliance_day($yesterday); 58 $arr['compliance_day'] = $this->compliance_day($yesterday);
59 //剩余服务时常 59 //剩余服务时常
60 - $arr['service_day'] = ((int)$v['service_duration'] - (int)$arr['compliance_day']); 60 + $arr['service_day'] = ((int)$v['service_duration'] - (int)$arr['compliance_day']) < 0 ?? 0;
61 //项目id 61 //项目id
62 $arr['project_id'] = $v['project_id']; 62 $arr['project_id'] = $v['project_id'];
63 $arr['created_at'] = date('Y-m-d H:i:s'); 63 $arr['created_at'] = date('Y-m-d H:i:s');
@@ -63,4 +63,21 @@ class RenewProjectController extends BaseController @@ -63,4 +63,21 @@ class RenewProjectController extends BaseController
63 $lists = $logic->renewListsLog($this->map,$this->page,$this->row,$this->order); 63 $lists = $logic->renewListsLog($this->map,$this->page,$this->row,$this->order);
64 $this->response('success',Code::SUCCESS,$lists); 64 $this->response('success',Code::SUCCESS,$lists);
65 } 65 }
  66 +
  67 + /**
  68 + * @remark :获取续费单详情
  69 + * @name :info
  70 + * @author :lyh
  71 + * @method :post
  72 + * @time :2023/8/14 9:08
  73 + */
  74 + public function info(RenewLogic $logic){
  75 + $this->request->validate([
  76 + 'id'=>'required',
  77 + ],[
  78 + 'id.required' => 'ID不能为空'
  79 + ]);
  80 + $info = $logic->renewRead();
  81 + $this->response('success',Code::SUCCESS,$info);
  82 + }
66 } 83 }
@@ -18,6 +18,7 @@ class RenewLogic extends BaseLogic @@ -18,6 +18,7 @@ class RenewLogic extends BaseLogic
18 public function __construct() 18 public function __construct()
19 { 19 {
20 parent::__construct(); 20 parent::__construct();
  21 + $this->param = $this->requestAll;
21 $this->model = new ProjectRenew(); 22 $this->model = new ProjectRenew();
22 } 23 }
23 24
@@ -38,4 +39,19 @@ class RenewLogic extends BaseLogic @@ -38,4 +39,19 @@ class RenewLogic extends BaseLogic
38 } 39 }
39 return $this->success($lists); 40 return $this->success($lists);
40 } 41 }
  42 +
  43 + /**
  44 + * @remark :根据主键获取续费单详情
  45 + * @name :renewRead
  46 + * @author :lyh
  47 + * @method :post
  48 + * @time :2023/8/14 9:12
  49 + */
  50 + public function renewRead(){
  51 + $info = $this->model->read(['id'=>$this->param['id']]);
  52 + if($info === false){
  53 + $this->fail('当前数据不存在或者被删除');
  54 + }
  55 + return $this->success($info);
  56 + }
41 } 57 }
@@ -153,7 +153,8 @@ Route::middleware(['aloginauth'])->group(function () { @@ -153,7 +153,8 @@ Route::middleware(['aloginauth'])->group(function () {
153 //续费 153 //续费
154 Route::prefix('renew')->group(function () { 154 Route::prefix('renew')->group(function () {
155 Route::any('/', [Aside\Project\RenewProjectController::class, 'lists'])->name('admin.renew'); 155 Route::any('/', [Aside\Project\RenewProjectController::class, 'lists'])->name('admin.renew');
156 - Route::any('/log', [Aside\Project\RenewProjectController::class, 'renewLists'])->name('admin.renewLists'); 156 + Route::any('/log', [Aside\Project\RenewProjectController::class, 'renewLists'])->name('admin.renew_renewLists');
  157 + Route::any('/info', [Aside\Project\RenewProjectController::class, 'info'])->name('admin.renew_info');
157 }); 158 });
158 //工单管理 159 //工单管理
159 Route::prefix('task')->group(function () { 160 Route::prefix('task')->group(function () {