Commit b004237f by 赵增煜

Merge branch 'develop' of http://git.imohe.com/zhaozengyu/tzt-admin into develop

parents 26906dd7 66d8a0d4
......@@ -115,12 +115,12 @@ public function drugLimit(Request $request)
$patient_id = $request->input('patient_id');
$pharmacy_id = $request->input('pharmacy_id');
# $sevenDaysAgo = Carbon::now()->subDays(7);
// $sevenDaysAgo = Carbon::now()->subDays(7);
$oneDayAgo = Carbon::now()->subDay();
$prescriptions = PrescriptionModel::where('patient_id', $patient_id)
->where('is_voided', PrescriptionModel::IS_VOIDED_FALSE) // 未作废的处方
->where('status', PrescriptionModel::PRESCRIPTION_STATUS_SUCCESS)
# ->where('pharmacy_id', $pharmacy_id)
// ->where('pharmacy_id', $pharmacy_id)
->where('created_at', '>=', $oneDayAgo)
->get();
......
......@@ -9,6 +9,7 @@
use App\Models\User;
use Illuminate\Http\Request;
use Jxlwqq\IdValidator\IdValidator;
use Milon\Barcode\DNS2D;
// 问诊人控制器
class PatientController extends BaseApiController
......@@ -186,4 +187,18 @@ public function getDefault(Request $request)
return $this->failed('暂无默认问诊人');
}
}
// 获取二维码
public function getQrCode(Request $request)
{
$scene = $request->input('scene');
if (! $scene) {
return $this->failed('请传入参数scene~');
}
$dns2d = new DNS2D();
$base64Img = 'data:image/jpg;base64,'.$dns2d->getBarcodePNG($scene, 'QRCODE', 200, 200);
// return "<img src={$base64Img} >";
return $this->success($base64Img);
}
}
<?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();
}
}
}
......@@ -170,6 +170,7 @@
// App\Providers\BroadcastServiceProvider::class,
App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class,
Milon\Barcode\BarcodeServiceProvider::class,
])->toArray(),
/*
......
......@@ -22,9 +22,7 @@
// 小程序静默登录
Route::post('login', 'App\Api\Controllers\UserController@login');
Route::get('test', 'App\Api\Controllers\SiteConfigController@test');
Route::get('qrcode', 'App\Api\Controllers\PatientController@getQrCode');
// 需要验证是否登录的路由组
Route::middleware(['jwt.auth', 'checkrole'])->group(function () {
......
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