修复导入价格
This commit is contained in:
@@ -717,7 +717,7 @@ class WareController extends BaseAdminController
|
||||
{
|
||||
\Yii::$app->response->format = Response::FORMAT_RAW;
|
||||
$params = \Yii::$app->request->post();
|
||||
$parameter['header'] = ['药品ID', '药品名称', '供货价', '销售价格'];
|
||||
$parameter['header'] = ['药品ID', '药品名称', '供货价', '建议零售价'];
|
||||
$parameter['data'] = DrugStoreDrug::inventory($params, \Yii::$app->user->identity->store_id);
|
||||
ExportService::ExportByCors($parameter);
|
||||
}
|
||||
|
||||
@@ -362,14 +362,14 @@ class ImportForm extends BaseModel
|
||||
$errors[] = $item['药品ID'] . '导入失败,原因:药品ID为空';
|
||||
continue;
|
||||
}
|
||||
if (empty(trim($item['销售价格']))) {
|
||||
$errors[] = $item['药品ID'] . '导入失败,原因:药品价格为空【' . $item['销售价格'] . '】';
|
||||
if (empty(trim($item['建议零售价']))) {
|
||||
$errors[] = $item['药品ID'] . '导入失败,原因:药品价格为空【' . $item['建议零售价'] . '】';
|
||||
continue;
|
||||
}
|
||||
$DrugStoreDrug = DrugStoreDrug::find()->where(['drug_id' => trim($item['药品ID'])])->one();
|
||||
|
||||
if ($DrugStoreDrug) {
|
||||
if ($DrugStoreDrug->price == trim($item['销售价格']) && $DrugStoreDrug->market_price == trim($item['供货价'])) {
|
||||
if ($DrugStoreDrug->price == trim($item['建议零售价']) && $DrugStoreDrug->market_price == trim($item['供货价'])) {
|
||||
$errors[] = $item['药品ID'] . '导入失败,原因:价格未改变';
|
||||
} else {
|
||||
$DrugStoreDrug->setAttribute('market_price', trim($item['供货价']));
|
||||
|
||||
Reference in New Issue
Block a user