Commit 1dbc1010 by 赵增煜

本地冲突

parents 95ac4e25 8c394091
...@@ -38,6 +38,7 @@ public function getLogin(Content $content) ...@@ -38,6 +38,7 @@ public function getLogin(Content $content)
*/ */
public function postLogin(Request $request) public function postLogin(Request $request)
{ {
$role = $request->input('role'); // 获取角色参数
$credentials = $request->only([$this->username(), 'password']); $credentials = $request->only([$this->username(), 'password']);
$remember = (bool) $request->input('remember', false); $remember = (bool) $request->input('remember', false);
...@@ -58,6 +59,21 @@ public function postLogin(Request $request) ...@@ -58,6 +59,21 @@ public function postLogin(Request $request)
]); ]);
} }
// 检查用户角色是否为 pharmacy
if ($role === 'store' && $user && $user->role === 'pharmacy') {
// 验证短信验证码
$verificationCode = $request->input('verification_code');
// 假设您有一个方法来验证短信验证码
if (! $this->verifySmsCode($user->username, $verificationCode)) {
return $this->validationErrorsResponse([
'verification_code' => '验证码错误或已过期!',
]);
}
// 短信验证码验证通过,执行登录
return $this->guard()->login($user, $remember) ? $this->sendLoginResponse($request) : $this->sendFailedLoginResponse($request);
}
if ($this->guard()->attempt($credentials, $remember)) { if ($this->guard()->attempt($credentials, $remember)) {
return $this->sendLoginResponse($request); return $this->sendLoginResponse($request);
} }
......
...@@ -109,7 +109,7 @@ protected function form() ...@@ -109,7 +109,7 @@ protected function form()
$form->display('id')->width(4); $form->display('id')->width(4);
$form->text('name')->width(4)->required(); $form->text('name')->width(4)->required();
$form->text('code')->readonly()->width(4); $form->text('code')->readonly()->width(4);
$form->select('unit')->options(DrugUnitModel::all()->pluck('name', 'id'))->width(4); $form->select('unit')->options(DrugUnitModel::all()->pluck('name', 'name'))->width(4);
$form->text('spec')->width(4)->required(); $form->text('spec')->width(4)->required();
$form->text('dosage_form')->width(4)->required(); $form->text('dosage_form')->width(4)->required();
$form->text('factory')->width(4)->required(); $form->text('factory')->width(4)->required();
......
...@@ -20,7 +20,6 @@ protected function grid() ...@@ -20,7 +20,6 @@ protected function grid()
return Grid::make(new DrugUnitRepository(), function (Grid $grid) { return Grid::make(new DrugUnitRepository(), function (Grid $grid) {
$grid->model()->orderBy('id', 'DESC'); $grid->model()->orderBy('id', 'DESC');
$grid->column('id')->sortable();
$grid->column('name'); $grid->column('name');
$grid->filter(function (Grid\Filter $filter) { $grid->filter(function (Grid\Filter $filter) {
......
...@@ -118,7 +118,7 @@ protected function form() ...@@ -118,7 +118,7 @@ protected function form()
$form->hidden('pharmacy_id'); $form->hidden('pharmacy_id');
$form->text('pharmacy.name', '药店')->disable()->width(4); $form->text('pharmacy.name', '药店')->disable()->width(4);
$form->text('drug.name', '药品名称')->disable()->width(4); $form->text('drug.name', '药品名称')->disable()->width(4);
$form->select('unit')->options(DrugUnitModel::all()->pluck('name', 'id'))->width(4)->required(); $form->select('unit')->options(DrugUnitModel::all()->pluck('name', 'name'))->width(4)->required();
$disageList = DosageModel::pluck('dosage_desc', 'id'); $disageList = DosageModel::pluck('dosage_desc', 'id');
$form->select('dosage_id', '用法用量')->options($disageList)->width(4)->required(); $form->select('dosage_id', '用法用量')->options($disageList)->width(4)->required();
$form->text('batch_no')->width(4)->required(); $form->text('batch_no')->width(4)->required();
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
use App\Models\PrescriptionLogModel; use App\Models\PrescriptionLogModel;
use App\Models\PrescriptionModel; use App\Models\PrescriptionModel;
use Carbon\Carbon; use Carbon\Carbon;
use Illuminate\Http\Request; use Illuminate\Http\Request;
// 药店控制器 // 药店控制器
...@@ -95,6 +96,7 @@ public function prescription(Request $request) ...@@ -95,6 +96,7 @@ public function prescription(Request $request)
} }
$prescription->status = PrescriptionModel::PRESCRIPTION_STATUS_SUCCESS; $prescription->status = PrescriptionModel::PRESCRIPTION_STATUS_SUCCESS;
if ($prescription->save()) { if ($prescription->save()) {
$patient_id = $prescription->patient_id; $patient_id = $prescription->patient_id;
$patient = PatientModel::where('id', $patient_id)->first(); $patient = PatientModel::where('id', $patient_id)->first();
// TODO 增加审方日志 // TODO 增加审方日志
...@@ -105,6 +107,7 @@ public function prescription(Request $request) ...@@ -105,6 +107,7 @@ public function prescription(Request $request)
$pharmacistLog->log_info = $prescription->pharmacist_name.'在'.$currentTime.'为'.$prescription->patient_name.'('.$patient->mobile.')审方(处方单编号:'.$prescription->id.')'; $pharmacistLog->log_info = $prescription->pharmacist_name.'在'.$currentTime.'为'.$prescription->patient_name.'('.$patient->mobile.')审方(处方单编号:'.$prescription->id.')';
$pharmacistLog->save(); $pharmacistLog->save();
return $this->success('审方成功'); return $this->success('审方成功');
} else { } else {
return $this->failed('审方失败'); return $this->failed('审方失败');
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
"dcat/easy-excel": "^1.1", "dcat/easy-excel": "^1.1",
"dcat/laravel-admin": "2.*", "dcat/laravel-admin": "2.*",
"dcat/laravel-wherehasin": "^0.8.0", "dcat/laravel-wherehasin": "^0.8.0",
"guanguans/dcat-login-captcha": "^1.1",
"guzzlehttp/guzzle": "^7.2", "guzzlehttp/guzzle": "^7.2",
"intervention/image-laravel": "^1.3", "intervention/image-laravel": "^1.3",
"laravel/framework": "^10.10", "laravel/framework": "^10.10",
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "7a80c242ca9ec5a49929d8f748ff10ea", "content-hash": "b54216094cc29878a7e64585eed50e2a",
"packages": [ "packages": [
{ {
"name": "box/spout", "name": "box/spout",
...@@ -1299,157 +1299,6 @@ ...@@ -1299,157 +1299,6 @@
"time": "2024-07-20T21:45:45+00:00" "time": "2024-07-20T21:45:45+00:00"
}, },
{ {
"name": "gregwar/captcha",
"version": "v1.2.1",
"source": {
"type": "git",
"url": "https://github.com/Gregwar/Captcha.git",
"reference": "229d3cdfe33d6f1349e0aec94a26e9205a6db08e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Gregwar/Captcha/zipball/229d3cdfe33d6f1349e0aec94a26e9205a6db08e",
"reference": "229d3cdfe33d6f1349e0aec94a26e9205a6db08e",
"shasum": ""
},
"require": {
"ext-gd": "*",
"ext-mbstring": "*",
"php": ">=5.3.0",
"symfony/finder": "*"
},
"require-dev": {
"phpunit/phpunit": "^6.4"
},
"type": "library",
"autoload": {
"psr-4": {
"Gregwar\\": "src/Gregwar"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Grégoire Passault",
"email": "g.passault@gmail.com",
"homepage": "http://www.gregwar.com/"
},
{
"name": "Jeremy Livingston",
"email": "jeremy.j.livingston@gmail.com"
}
],
"description": "Captcha generator",
"homepage": "https://github.com/Gregwar/Captcha",
"keywords": [
"bot",
"captcha",
"spam"
],
"support": {
"issues": "https://github.com/Gregwar/Captcha/issues",
"source": "https://github.com/Gregwar/Captcha/tree/v1.2.1"
},
"time": "2023-09-26T13:45:37+00:00"
},
{
"name": "guanguans/dcat-login-captcha",
"version": "v1.1.0",
"source": {
"type": "git",
"url": "https://github.com/guanguans/dcat-login-captcha.git",
"reference": "e689bb108237f4176a2acbf5735409abc30f678e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guanguans/dcat-login-captcha/zipball/e689bb108237f4176a2acbf5735409abc30f678e",
"reference": "e689bb108237f4176a2acbf5735409abc30f678e",
"shasum": ""
},
"require": {
"dcat/laravel-admin": "^2.0",
"gregwar/captcha": "^1.1",
"php": ">=7.1"
},
"require-dev": {
"brainmaestro/composer-git-hooks": "^2.7",
"friendsofphp/php-cs-fixer": "^3.0",
"mockery/mockery": "^1.2",
"nyholm/nsa": "^1.2",
"overtrue/phplint": "^2.3 || ^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0",
"phpbench/phpbench": "^1.0",
"phpunit/phpunit": "^8.0 || ^9.0",
"vimeo/psalm": "^4.0 || ^5.0"
},
"type": "library",
"extra": {
"dcat-admin": "Guanguans\\DcatLoginCaptcha\\LoginCaptchaServiceProvider",
"hooks": {
"post-merge": [
"composer checks"
],
"pre-commit": [
"composer checks"
]
},
"laravel": {
"aliases": {
"CaptchaBuilder": "Guanguans\\DcatLoginCaptcha\\Facades\\CaptchaBuilder",
"PhraseBuilder": "Guanguans\\DcatLoginCaptcha\\Facades\\PhraseBuilder"
},
"providers": [
"Guanguans\\DcatLoginCaptcha\\LoginCaptchaServiceProvider"
]
}
},
"autoload": {
"files": [
"src/helpers.php"
],
"psr-4": {
"Guanguans\\DcatLoginCaptcha\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "<a href='https://github.com/guanguans' target='_blank'>guanguans</a>",
"email": "ityaozm@gmail.com",
"homepage": "https://www.guanguans.cn",
"role": "developer"
}
],
"description": "Dcat admin login captcha. - Dcat admin 登录验证码。",
"homepage": "https://github.com/guanguans/dcat-login-captcha",
"keywords": [
"admin",
"captcha",
"dcat",
"dcat-admin",
"extension",
"laravel",
"login",
"login-captcha"
],
"support": {
"issues": "https://github.com/guanguans/dcat-login-captcha/issues",
"source": "https://github.com/guanguans/dcat-login-captcha"
},
"funding": [
{
"url": "https://www.guanguans.cn/images/wechat.jpeg",
"type": "wechat"
}
],
"time": "2023-03-20T09:40:06+00:00"
},
{
"name": "guzzlehttp/guzzle", "name": "guzzlehttp/guzzle",
"version": "7.9.2", "version": "7.9.2",
"source": { "source": {
......
...@@ -19,13 +19,15 @@ public function up() ...@@ -19,13 +19,15 @@ public function up()
$table->string('name')->index('idx_name')->comment('药品名称'); $table->string('name')->index('idx_name')->comment('药品名称');
$table->string('code')->index('idx_code')->comment('简码'); $table->string('code')->index('idx_code')->comment('简码');
$table->string('standard_code')->unique('uk_standardcode')->comment('本位码'); $table->string('standard_code')->unique('uk_standardcode')->comment('本位码');
$table->integer('unit')->nullable()->comment('单位'); $table->string('unit', 20)->nullable()->comment('单位');
$table->string('spec')->comment('规格'); $table->string('spec')->comment('规格');
$table->string('dosage_form')->comment('剂型'); $table->string('dosage_form')->comment('剂型');
$table->string('factory')->index('idx_factory')->comment('生产厂家'); $table->string('factory')->index('idx_factory')->comment('生产厂家');
$table->string('approval_no')->comment('批准文号'); $table->string('approval_no')->comment('批准文号');
$table->integer('limit_buy_7')->default(0)->comment('7天内限购数量'); $table->integer('limit_buy_7')->default(0)->comment('7天内限购数量');
$table->boolean('is_rx')->default(false)->comment('是否处方药'); $table->boolean('is_rx')->default(false)->comment('是否处方药');
$table->boolean('is_si')->default(false)->comment('是否医保药品');
$table->integer('product_id')->default(0)->comment('君元ID');
$table->timestamps(); $table->timestamps();
$table->softDeletes(); $table->softDeletes();
}); });
......
...@@ -16,7 +16,7 @@ public function up(): void ...@@ -16,7 +16,7 @@ public function up(): void
$table->bigIncrements('id'); $table->bigIncrements('id');
$table->bigInteger('pharmacy_id')->comment('药店ID'); $table->bigInteger('pharmacy_id')->comment('药店ID');
$table->bigInteger('drug_id')->comment('药品池ID'); $table->bigInteger('drug_id')->comment('药品池ID');
$table->integer('unit')->nullable()->comment('单位'); $table->string('unit', 20)->nullable()->comment('单位');
$table->bigInteger('dosage_id')->nullable()->comment('用法用量表ID'); $table->bigInteger('dosage_id')->nullable()->comment('用法用量表ID');
$table->string('batch_no', 64)->nullable()->comment('批次号'); $table->string('batch_no', 64)->nullable()->comment('批次号');
$table->unique(['pharmacy_id', 'drug_id'], 'uk_pharmacyid_drugid'); $table->unique(['pharmacy_id', 'drug_id'], 'uk_pharmacyid_drugid');
......
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