Commit ab8777d2 by lujunyi

刷新问诊问题

parent b567b75b
<?php
namespace App\Console\Commands;
use App\Models\InquiryModel;
use App\Models\PrescriptionModel;
use Illuminate\Console\Command;
class TestCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'mohe:test';
/**
* The console command description.
*
* @var string
*/
protected $description = '测试命令';
/**
* Execute the console command.
*/
public function handle()
{
// 刷新问诊问题
$prescriptions = PrescriptionModel::all();
foreach ($prescriptions as $prescription) {
$inquiry_info = $prescription->inquiry_info;
foreach ($inquiry_info as &$v) {
$v['question'] = InquiryModel::find($v['inquiry_id'])->question;
}
$prescription->inquiry_info = $inquiry_info;
$prescription->save();
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment