订单详情不加诊所限制(给互联网医院转的在线复诊留口子)
This commit is contained in:
@@ -11,6 +11,7 @@ use common\helpers\FuncHelper;
|
||||
use common\models\oldDb\DoctorPatient;
|
||||
use common\models\oldDb\Register;
|
||||
use common\models\oldDb\ServiceUser;
|
||||
use common\models\oldDb\Store;
|
||||
use common\models\oldDb\StoreDoctor;
|
||||
use common\models\oldDb\UserPatient;
|
||||
use common\modelsgii\oldDb\PayConfig;
|
||||
@@ -116,9 +117,19 @@ class RegisterForm extends BaseModel
|
||||
|
||||
$t = \Yii::$app->db->beginTransaction();
|
||||
try {
|
||||
// 确定实际使用的门店ID
|
||||
// 如果是购药(register_type=3)且当前门店(药店)配置了委托诊所,则使用委托诊所ID
|
||||
$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;
|
||||
}
|
||||
}
|
||||
|
||||
$UserRegister = new Register();
|
||||
$UserRegister->user_id = \Yii::$app->user->id;
|
||||
$UserRegister->store_id = \Yii::$app->store;
|
||||
$UserRegister->store_id = $actualStoreId;
|
||||
$UserRegister->order_no = FuncHelper::generate_order_no('SN');
|
||||
$UserRegister->user_patient_id = $this->user_patient_id;
|
||||
$UserRegister->service_user_id = $this->service_user_id;
|
||||
|
||||
Reference in New Issue
Block a user