1
0
Fork 0
master
panliang 2023-10-10 23:14:19 +08:00
parent 61cfba421a
commit e1a90d66a8
4 changed files with 6 additions and 3 deletions

View File

@ -70,7 +70,7 @@ class PatientRecordController extends AdminController
['type' => 'text', 'text' => __('patient-record.doctor_money').': ${doctor_money}', 'colSpan' => 2],
['type' => 'text', 'text' => __('patient-record.inviter_money').': ${inviter_money}', 'colSpan' => 2],
['type' => 'text', 'text' => __('patient-record.saler_money').': ${saler_money}', 'colSpan' => 2],
['type' => 'text', 'text' => ''],
['type' => 'text', 'text' => __('patient-record.total_money').': ${total_money}'],
]);
return $this->baseList($crud);

View File

@ -41,12 +41,14 @@ class PatientRecordService extends BaseService
$list = $query->clone()->paginate(request()->input('perPage', 20));
$items = $list->items();
$total = $list->total();
$sell_price = round($query->clone()->sum('sell_price'), 2, PHP_ROUND_HALF_DOWN);
$doctor_money = round($query->clone()->sum('doctor_money'), 2, PHP_ROUND_HALF_DOWN);
$inviter_money = round($query->clone()->sum('inviter_money'), 2, PHP_ROUND_HALF_DOWN);
$saler_money = round($query->clone()->sum('saler_money'), 2, PHP_ROUND_HALF_DOWN);
$total_money = round($doctor_money + $inviter_money + $saler_money, 2, PHP_ROUND_HALF_DOWN);
return compact('items', 'total', 'sell_price', 'doctor_money', 'inviter_money', 'saler_money');
return compact('items', 'total', 'sell_price', 'doctor_money', 'inviter_money', 'saler_money', 'total_money');
}
public function resloveData($data, $model = null)

View File

@ -17,7 +17,7 @@ return new class extends Migration
$table->unsignedBigInteger('type_id')->comment('类别, keywords.id');
$table->unsignedBigInteger('illness_type_id')->comment('病种, keywords.id');
$table->timestamp('treat_at')->comment('就诊时间');
$table->text('content')->comment('就诊情况');
$table->text('content')->nullable()->comment('就诊情况');
$table->json('images')->nullable()->comment('图片');
$table->decimal('origin_price')->default(0)->comment('划线价');
$table->decimal('sell_price')->default(0)->comment('实收价');

View File

@ -28,4 +28,5 @@ return [
'created_at' => '录入时间',
'images' => '图片资料',
'illness_type_id' => '病种',
'total_money' => '总提成',
];