You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.1 KiB

6 months ago
<?php
/**
* Created by PhpStorm.
* User: weizongsong
* Date: 2025-10-23
* Time: 21:00
*/
namespace App\Http\Controllers\Admin;
use App\Forms\OrderAgreementForm;
use App\Models\OrderAgreement;
use Illuminate\Http\Request;
class OrderAgreementController extends CommonController
{
public $bladePath = "admin.order-agreement";
public $urlPrefix = "admin/order-agreement";
public $modelName = "订单协议";
public $modelClass = OrderAgreement::class;
public $formClass = OrderAgreementForm::class;
public function index(Request $request)
{
$query = $this->model->with(['order', 'paramedicSign', 'customerSign', 'companySign', 'file']);
// 搜索功能
if ($request->order_id) {
$query->where('order_id', $request->order_id);
}
if ($request->customer_id) {
$query->where('customer_id', $request->customer_id);
}
if ($request->paramedic_id) {
$query->where('paramedic_id', $request->paramedic_id);
}
$data = $query->orderBy('id', 'desc')->paginate(10);
return view($this->bladePath . ".index", compact("data"));
}
}