feat(warehouse_product): 添加商品出入库信息

This commit is contained in:
mkm 2024-08-16 13:48:47 +08:00
parent 09d597fcf7
commit 10557af2d3
6 changed files with 35 additions and 4 deletions

View File

@ -130,7 +130,14 @@ class StoreProductController extends BaseAdminController
StoreProductLogic::ordinary($arr, $store_id, $this->adminId, $find, $warehouse_id);
} else {
WarehouseProductLogic::add($data);
StoreBranchProduct::where('product_id', $arr['id'])->where('store_id', $store_id)->inc('stock', $arr['stock'])->update();
$find = StoreBranchProduct::where('product_id', $arr['id'])->where('store_id', $store_id)->find();
if ($find) {
StoreBranchProduct::where('id', $find['id'])->inc('stock', $arr['stock'])->update();
} else {
$find = StoreProduct::where('id', $arr['id'])->findOrEmpty()->toArray();
StoreProductLogic::ordinary($arr, $store_id, $this->adminId, $find, $warehouse_id);
StoreBranchProduct::where('product_id', $arr['id'])->where('store_id', $store_id)->inc('stock', $arr['stock'])->update();
}
}
// StoreProductLogic::ordinary($arr, $store_id, $this->adminId, $find, $warehouse_id);
@ -154,7 +161,13 @@ class StoreProductController extends BaseAdminController
StoreProductLogic::ordinary($arr, $store_id, $this->adminId, $find, $warehouse_id);
} else {
WarehouseProductLogic::add($data);
StoreBranchProduct::where('product_id', $arr['id'])->where('store_id', $store_id)->inc('stock', $arr['stock'])->update();
$find = StoreBranchProduct::where('product_id', $arr['id'])->where('store_id', $store_id)->find();
if ($find) {
StoreBranchProduct::where('id', $find['id'])->inc('stock', $arr['stock'])->update();
} else {
StoreProductLogic::ordinary($arr, $store_id, $this->adminId, $find, $warehouse_id);
StoreBranchProduct::where('product_id', $arr['id'])->where('store_id', $store_id)->inc('stock', $arr['stock'])->update();
}
}
// $find = StoreProduct::where('id', $arr['id'])->findOrEmpty()->toArray();

View File

@ -56,6 +56,8 @@ class SystemStoreStorageController extends BaseAdminController
*/
public function edit()
{
return $this->fail('暂不支持入库操作');
// $params = (new SystemStoreStorageValidate())->post()->goCheck('edit');
// $params['admin_id']=$this->adminId;
// $result = SystemStoreStorageLogic::edit($params);

View File

@ -31,7 +31,7 @@ class WarehouseProductController extends BaseAdminController
/**
* @notes 添加商品仓储信息
* @notes 添加商品出入库信息
* @return \think\response\Json
* @author admin
* @date 2024/07/31 16:55

View File

@ -86,6 +86,7 @@ class WarehouseProductLogic extends BaseLogic
}
$res = WarehouseProduct::create($data);
//更改采购订单状态
if(isset($params['purchase_product_offer_id']) &&$params['purchase_product_offer_id']!=''){
PurchaseProductOffer::where('id',$params['purchase_product_offer_id'])->update(['is_storage'=>1,'supplier_id'=>$params['supplier_id']??0]);
}

View File

@ -293,8 +293,9 @@ class UserController extends BaseApiController
*/
public function cash_info()
{
$info = User::where('id', $this->userId)->field('id,now_money')->find();
$info = User::where('id', $this->userId)->field('id,now_money,id_card')->find();
$info['notes'] = '提现金额需大于1元提现到微信零钱并财务审核审核通过后提现金额将自动到账';
$info['extract_price'] =StoreExtract::where('uid',$this->userId)->sum('extract_price');
return $this->data($info);
}
@ -352,4 +353,16 @@ class UserController extends BaseApiController
})->toArray();
return $this->data($list);
}
/**
* 更新身份证号
*/
public function update_id_card(){
$id_card = $this->request->post('id_card');
if($id_card){
User::where('id',$this->userId)->update(['id_card'=>$id_card]);
return $this->success('设置成功');
}
return $this->fail('请输入身份证号');
}
}

View File

@ -34,6 +34,8 @@ class SystemStoreStorageController extends BaseAdminController
public function edit()
{
return $this->fail('暂不支持入库操作');
$id = $this->request->post('id',0);
if($id==0){
return $this->fail('参数错误');