门店查询逻辑
This commit is contained in:
@@ -119,12 +119,19 @@ class RegisterForm extends BaseModel
|
||||
try {
|
||||
// 确定实际使用的门店ID
|
||||
// 如果是购药(register_type=3)且当前门店(药店)配置了委托诊所,则使用委托诊所ID
|
||||
// 如果是诊所在线复诊(register_type=2),需要确保是诊所(store.type=0)
|
||||
$actualStoreId = \Yii::$app->store;
|
||||
if ($this->register_type == 3) {
|
||||
$currentStore = Store::findOne($actualStoreId);
|
||||
if ($currentStore && !empty($currentStore->delegate_store_id)) {
|
||||
$actualStoreId = $currentStore->delegate_store_id;
|
||||
}
|
||||
} elseif ($this->register_type == 2) {
|
||||
// 诊所在线复诊:确保是诊所(store.type=0)
|
||||
$currentStore = Store::findOne($actualStoreId);
|
||||
if ($currentStore && $currentStore->type != 0) {
|
||||
throw new Exception('诊所在线复诊只能在诊所进行');
|
||||
}
|
||||
}
|
||||
|
||||
$UserRegister = new Register();
|
||||
|
||||
Reference in New Issue
Block a user