1
This commit is contained in:
@@ -216,20 +216,56 @@ class TestController extends AbstractController
|
||||
"frequency_use" => "1天3次",
|
||||
"single_use" => "口服",
|
||||
"prescription_product_num" => "X1盒",
|
||||
]
|
||||
],
|
||||
[
|
||||
"product_name" => "感冒药3(50ml*10)",
|
||||
"single_unit" => "一次一包",
|
||||
"frequency_use" => "1天3次",
|
||||
"single_use" => "口服",
|
||||
"prescription_product_num" => "X1盒",
|
||||
],
|
||||
[
|
||||
"product_name" => "感冒药4(50ml*10)",
|
||||
"single_unit" => "一次一包",
|
||||
"frequency_use" => "1天3次",
|
||||
"single_use" => "口服",
|
||||
"prescription_product_num" => "X1盒",
|
||||
],
|
||||
[
|
||||
"product_name" => "感冒药5(50ml*10)",
|
||||
"single_unit" => "一次一包",
|
||||
"frequency_use" => "1天3次",
|
||||
"single_use" => "口服",
|
||||
"prescription_product_num" => "X1盒",
|
||||
],
|
||||
];
|
||||
|
||||
// 用药
|
||||
foreach ($data['product'] as $key => $item){
|
||||
$image->text($item['product_name'], 229, 1530 + ($key+1) * 100, function ($font) use($fontPath) {
|
||||
if ($key <= 2){
|
||||
$x_axis = 229;
|
||||
$y_axis = 1600 + $key * 350;
|
||||
}else{
|
||||
$x_axis = 1240;
|
||||
$y_axis = 1600 + ($key - 3) * 350;
|
||||
}
|
||||
|
||||
|
||||
$image->text($item['product_name'], $x_axis, $y_axis, function ($font) use($fontPath) {
|
||||
$font->file($fontPath);
|
||||
$font->size(60);
|
||||
$font->size(50);
|
||||
$font->align('left');
|
||||
});
|
||||
|
||||
$image->text("用量:" . $item['single_unit'] . " " . $item['frequency_use'], 229, 1530 + ($key+1) * 100, function ($font) use($fontPath) {
|
||||
$image->text("用量:" . $item['single_unit'] . " " . $item['frequency_use'], $x_axis, $y_axis+90, function ($font) use($fontPath) {
|
||||
$font->file($fontPath);
|
||||
$font->size(60);
|
||||
$font->size(50);
|
||||
$font->align('left');
|
||||
});
|
||||
|
||||
$image->text("用法:" . $item['single_use'], $x_axis, $y_axis+180, function ($font) use($fontPath) {
|
||||
$font->file($fontPath);
|
||||
$font->size(50);
|
||||
$font->align('left');
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user