修改批量入库

This commit is contained in:
lewis 2025-01-14 11:38:18 +08:00
parent e2014342bd
commit c12a519bcd
3 changed files with 8 additions and 2 deletions

View File

@ -99,7 +99,8 @@ class SystemStoreStorageController extends BaseAdminController
*/
public function batchConfirm()
{
SystemStoreStorageLogic::editAll([], $this->adminId);
$params = $this->request->post();
SystemStoreStorageLogic::editAll($params, $this->adminId);
return $this->success('操作成功',[]);
}

View File

@ -152,6 +152,7 @@ class StoreBranchProductLists extends BaseAdminDataLists implements ListsSearchI
{
$data = [
'product_id' => '商品ID',
'system_store_name' => '门店',
'store_name' => '商品名称',
'store_info' => '规格',
'unit_name' => '单位',

View File

@ -96,9 +96,13 @@ class SystemStoreStorageLogic extends BaseLogic
public static function editAll(array $params, $adminId = 0): bool
{
$where = ['status' => 0];
if (isset($params['store_id'])) {
if (!empty($params['store_id'])) {
$where['store_id'] = $params['store_id'];
}
if (!empty($params['product_name'])) {
$productIds = StoreProduct::where('store_name', 'like', '%' . $params['product_name'] . '%')->column('id');
$where[] = ['product_id', 'in', $productIds];
}
$list = SystemStoreStorage::where($where)->column('id');
foreach ($list as $item) {
$params['id'] = $item;