feat(warehouse_product): 添加商品出入库信息
This commit is contained in:
parent
09d597fcf7
commit
10557af2d3
@ -130,8 +130,15 @@ class StoreProductController extends BaseAdminController
|
|||||||
StoreProductLogic::ordinary($arr, $store_id, $this->adminId, $find, $warehouse_id);
|
StoreProductLogic::ordinary($arr, $store_id, $this->adminId, $find, $warehouse_id);
|
||||||
} else {
|
} else {
|
||||||
WarehouseProductLogic::add($data);
|
WarehouseProductLogic::add($data);
|
||||||
|
$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();
|
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);
|
// StoreProductLogic::ordinary($arr, $store_id, $this->adminId, $find, $warehouse_id);
|
||||||
|
|
||||||
// Redis::send('store-storage', ['product_arr' => $arr, 'store_id' => $store_id, 'stock_type' => $stock_type, 'admin_id' => $this->adminId, 'warehouse_id' => $warehouse_id]);
|
// Redis::send('store-storage', ['product_arr' => $arr, 'store_id' => $store_id, 'stock_type' => $stock_type, 'admin_id' => $this->adminId, 'warehouse_id' => $warehouse_id]);
|
||||||
@ -154,8 +161,14 @@ class StoreProductController extends BaseAdminController
|
|||||||
StoreProductLogic::ordinary($arr, $store_id, $this->adminId, $find, $warehouse_id);
|
StoreProductLogic::ordinary($arr, $store_id, $this->adminId, $find, $warehouse_id);
|
||||||
} else {
|
} else {
|
||||||
WarehouseProductLogic::add($data);
|
WarehouseProductLogic::add($data);
|
||||||
|
$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();
|
StoreBranchProduct::where('product_id', $arr['id'])->where('store_id', $store_id)->inc('stock', $arr['stock'])->update();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// $find = StoreProduct::where('id', $arr['id'])->findOrEmpty()->toArray();
|
// $find = StoreProduct::where('id', $arr['id'])->findOrEmpty()->toArray();
|
||||||
// StoreProductLogic::ordinary($arr, $store_id, $this->adminId, $find, $warehouse_id);
|
// StoreProductLogic::ordinary($arr, $store_id, $this->adminId, $find, $warehouse_id);
|
||||||
|
@ -56,6 +56,8 @@ class SystemStoreStorageController extends BaseAdminController
|
|||||||
*/
|
*/
|
||||||
public function edit()
|
public function edit()
|
||||||
{
|
{
|
||||||
|
return $this->fail('暂不支持入库操作');
|
||||||
|
|
||||||
// $params = (new SystemStoreStorageValidate())->post()->goCheck('edit');
|
// $params = (new SystemStoreStorageValidate())->post()->goCheck('edit');
|
||||||
// $params['admin_id']=$this->adminId;
|
// $params['admin_id']=$this->adminId;
|
||||||
// $result = SystemStoreStorageLogic::edit($params);
|
// $result = SystemStoreStorageLogic::edit($params);
|
||||||
|
@ -31,7 +31,7 @@ class WarehouseProductController extends BaseAdminController
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @notes 添加商品仓储信息
|
* @notes 添加商品出入库信息
|
||||||
* @return \think\response\Json
|
* @return \think\response\Json
|
||||||
* @author admin
|
* @author admin
|
||||||
* @date 2024/07/31 16:55
|
* @date 2024/07/31 16:55
|
||||||
|
@ -86,6 +86,7 @@ class WarehouseProductLogic extends BaseLogic
|
|||||||
}
|
}
|
||||||
$res = WarehouseProduct::create($data);
|
$res = WarehouseProduct::create($data);
|
||||||
|
|
||||||
|
//更改采购订单状态
|
||||||
if(isset($params['purchase_product_offer_id']) &&$params['purchase_product_offer_id']!=''){
|
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]);
|
PurchaseProductOffer::where('id',$params['purchase_product_offer_id'])->update(['is_storage'=>1,'supplier_id'=>$params['supplier_id']??0]);
|
||||||
}
|
}
|
||||||
|
@ -293,8 +293,9 @@ class UserController extends BaseApiController
|
|||||||
*/
|
*/
|
||||||
public function cash_info()
|
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['notes'] = '提现金额需大于1元,提现到微信零钱,并财务审核,审核通过后,提现金额将自动到账';
|
||||||
|
$info['extract_price'] =StoreExtract::where('uid',$this->userId)->sum('extract_price');
|
||||||
return $this->data($info);
|
return $this->data($info);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -352,4 +353,16 @@ class UserController extends BaseApiController
|
|||||||
})->toArray();
|
})->toArray();
|
||||||
return $this->data($list);
|
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('请输入身份证号');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,6 +34,8 @@ class SystemStoreStorageController extends BaseAdminController
|
|||||||
|
|
||||||
public function edit()
|
public function edit()
|
||||||
{
|
{
|
||||||
|
return $this->fail('暂不支持入库操作');
|
||||||
|
|
||||||
$id = $this->request->post('id',0);
|
$id = $this->request->post('id',0);
|
||||||
if($id==0){
|
if($id==0){
|
||||||
return $this->fail('参数错误');
|
return $this->fail('参数错误');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user