求数组中的对应关系
1 |
|
数组1 代表 取得的总数量。
数组2 代表 stockno(SU开头部分)时对应的数量,值为第[5]项。
数组3 代表 stockno 在数组中的序列。
能不能根据数组3的序列求得,
stockno为SU13061301033时,对应数组1中的前210项对应stockno为SU13061301033 ,
stockno为SU13061301032时,对应数组1中的剩余的项对应stockno为SU13061301033 。
依次类推这种情况。
是否存在这种对应关系?
回复讨论(解决方案)
您的 数组1 不就只有一组数据吗?
您的 数组1 不就只有一组数据吗?
这样就无法匹配是吗?数组1和数组3只有对应关系才能求得结果。
如果实在找不到对应关系的话就无法求得需要的值?
对应数组1中的 前210项 这个怎么说?
对应数组1中的 前210项 这个怎么说?
我的意思是数组3中的stockno排在前面的,比如第一项SU13061301033,对应数组2中的值是210。然后用数组1中的总数量去分配210这个值,后面的stockno用总数量-210的结果再去分配下一组值。
PS:可能结果出了问题,所以我要重新查看下sql语句。稍晚再回复您。
如果用排队,倒是可以的
但关键还是在于你数据间的依赖性
如果用排队,倒是可以的
但关键还是在于你数据间的依赖性
好的。明天麻烦你指导下。
还需要你理清思绪路
贴数据时,请帖 var_export 的结果,而不是 print_r 的结果
与人方便,与己方便
结果存储的问题吧
还需要你理清思绪路
贴数据时,请帖 var_export 的结果,而不是 print_r 的结果
与人方便,与己方便
有三张表:kw_manage,vp_barcode_2d_y,stock_detail,分别对应库存,库存对应的批次lotno,出库信息。
库存以packageno为单位入库,通过vp_barcode_2d_y这张表求得入库的packageno对应的批次lotno及数量,cust_no,出库stock_detail含有信息stock_no,对应的关系:一个stock_no对应多个cust_no和对应的数量。
例如下:
1 |
|
PS:图中数量为10*15 (箱数*每箱的个数)
也就是说stock_no和packageno之间没有必然联系,是否可以通过按批次lotno的先入先出来处理对应关系?
或者说你需要哪部分var_export的结果?
或略具体品种,即一下的讨论值针对单一的品种
入库时有 入库批次和数量 两个属性
出库时有 出库批次和数量 两个属性
你似乎是需要统计:在某个出库批次中都是由哪些入库批次构成的
我理解的对吗?
或略具体品种,即一下的讨论值针对单一的品种
入库时有 入库批次和数量 两个属性
出库时有 出库批次和数量 两个属性
你似乎是需要统计:在某个出库批次中都是由哪些入库批次构成的
我理解的对吗?
是这样。理解正确。
通常情况,我是先正常入库,再根据出库的要求(stock_detail表)用入库的信息来匹配要求。
入库:
1 |
|
本着先进先出的原则,出库过程是这样的:
出库数量已知
遍历入库表,从 出库数量 中扣除当前入库批次的数量,直到 出库数量 小于等于 0
若 出库数量 为负,则将其绝对值加回去
本着先进先出的原则,出库过程是这样的:
出库数量已知
遍历入库表,从 出库数量 中扣除当前入库批次的数量,直到 出库数量 小于等于 0
若 出库数量 为负,则将其绝对值加回去
出库:
1 |
|
入库:
1 |
|
你贴 入库 的代码是什么意思?
你贴 入库 的代码是什么意思?
不需要知道入库总量?如何去判定入库的批次已匹配过,不回出现在其他的stock_no的结果中?
你给的数据和代码不配套
Unknown column 'arr_time' in 'field list'
刚才出库的数据没给全,贴不下了。现在补上。
1 |
|
你给的数据和代码不配套
Unknown column 'arr_time' in 'field list'
烦见20#
本着先进先出的原则,出库过程是这样的:
出库数量已知
遍历入库表,从 出库数量 中扣除当前入库批次的数量,直到 出库数量 小于等于 0
若 出库数量 为负,则将其绝对值加回去
烦请举个例子吧,对这句话的意思不理解。
遍历入库表,从 出库数量 中扣除当前入库批次的数量

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Laravel simplifies handling temporary session data using its intuitive flash methods. This is perfect for displaying brief messages, alerts, or notifications within your application. Data persists only for the subsequent request by default: $request-

The PHP Client URL (cURL) extension is a powerful tool for developers, enabling seamless interaction with remote servers and REST APIs. By leveraging libcurl, a well-respected multi-protocol file transfer library, PHP cURL facilitates efficient execution of various network protocols, including HTTP, HTTPS, and FTP. This extension offers granular control over HTTP requests, supports multiple concurrent operations, and provides built-in security features.

Laravel provides concise HTTP response simulation syntax, simplifying HTTP interaction testing. This approach significantly reduces code redundancy while making your test simulation more intuitive. The basic implementation provides a variety of response type shortcuts: use Illuminate\Support\Facades\Http; Http::fake([ 'google.com' => 'Hello World', 'github.com' => ['foo' => 'bar'], 'forge.laravel.com' =>

Alipay PHP...

Do you want to provide real-time, instant solutions to your customers' most pressing problems? Live chat lets you have real-time conversations with customers and resolve their problems instantly. It allows you to provide faster service to your custom

Article discusses late static binding (LSB) in PHP, introduced in PHP 5.3, allowing runtime resolution of static method calls for more flexible inheritance.Main issue: LSB vs. traditional polymorphism; LSB's practical applications and potential perfo

The article discusses adding custom functionality to frameworks, focusing on understanding architecture, identifying extension points, and best practices for integration and debugging.

Sending JSON data using PHP's cURL library In PHP development, it is often necessary to interact with external APIs. One of the common ways is to use cURL library to send POST�...
