Table of Contents
回复讨论(解决方案)
Home Backend Development PHP Tutorial 按照出库要求信息匹配入库的批次信息

按照出库要求信息匹配入库的批次信息

Jun 23, 2016 pm 02:18 PM

本帖最后由 lazygc520 于 2013-08-07 09:39:09 编辑

数据库分为3张表,kw,vp,st开头的三张表,前两张表代表入库,st开头的代表出库要求。入库的话前两张表联合查询求得已入库的cust_no和lotno,出库表已知stockno的信息及对应的cust_no,stockno存在排序关系,按照表st中的字段c1_time,c_type,adress来排序,stockno按照顺序排列,lotno按照先入先出的排序规则和stockno的对应数量匹配,对等的话则排除已匹配的lotno,新的lotno和接下来的stockno相匹配直至数量符合要求,依次类推。数量的结果是st表中,mount*snp的结果。能否用遍历入库表的信息来完成此操作?

上传附件地址:http://download.csdn.net/detail/lazygc520/5882535

已知入库的数据、出库的要求,根据出库要求来匹配入库的批次数据。
例如:在ch_result页面,ch_result.php?stockno=SU13061301010,实现出货批次那一栏的数据。

kw,vp表联合查询得到的cust_no和lotno得到的结果:
$sql = "select CONCAT(SUBSTRING_INDEX(a.cust_no,' ',1),SUBSTRING_INDEX(a.cust_no,' ',-1)) as cust_no,b.lotno as lotno,count(b.lotno) as lotno_count from `kw_manage` as a,`vp_barcode_2d_y` as b where a.packageno = b.packageno group by lotno order by lotno asc";$result = mysql_query($sql);$ars =array();while($row = mysql_fetch_array($result,MYSQL_ASSOC)){	$ars[] = $row;}var_dump($ars);得到的结果:array(1) { [0]=> array(3) { ["cust_no"]=> string(10) "237033AW0A" ["lotno"]=> string(4) "3207" ["lotno_count"]=> string(3) "480" } }
Copy after login





回复讨论(解决方案)

如果你不能简化你的问题(抽取出问题的核心,只保留核心数据)
估计没有人有时间去看的

如果你不能简化你的问题(抽取出问题的核心,只保留核心数据)
估计没有人有时间去看的
整理了一下:

//按照先入先出得到已入库的零件号码及产品批次$sql = "SELECT a.cust_no, a.lotno, count( a.lotno ) FROM vp_barcode_2d_y AS a RIGHT JOIN kw_manage AS b ON a.packageno = b.packageno GROUP BY a.lotno ORDER BY a.lotno, a.cust_no ASC";$result = mysql_query($sql);while($v1 = mysql_fetch_array($result,MYSQL_ASSOC)){	var_dump($v1);}/*array(3) {  ["cust_no"]=>  string(11) "23703 3AW0A"  ["lotno"]=>  string(4) "3207"  ["count( a.lotno )"]=>  string(3) "480"}array(3) {  ["cust_no"]=>  string(11) "23703 3AW0A"  ["lotno"]=>  string(4) "3218"  ["count( a.lotno )"]=>  string(3) "180"}*///按照先纳时,再到运地,再车型的顺序求得出库依赖的结果:$sql2 = "SELECT stock_no, cust_no, mount * snp AS total FROM `stock_detail` ORDER BY arr_time, adress, c_type ASC";$result2 = mysql_query($sql2);while($v2 = mysql_fetch_array($result2,MYSQL_ASSOC)){	var_dump($v2);}/*array(3) {  ["stock_no"]=  string(13) "SU13061301011"  ["cust_no"]=  string(10) "237033AW0A"  ["total"]=  string(3) "195"}array(3) {  ["stock_no"]=  string(13) "SU13061301011"  ["cust_no"]=  string(10) "237033AW0A"  ["total"]=  string(3) "195"}array(3) {  ["stock_no"]=  string(13) "SU13061301016"  ["cust_no"]=  string(10) "23703JX30A"  ["total"]=  string(2) "15"}array(3) {  ["stock_no"]=  string(13) "SU13061301016"  ["cust_no"]=  string(10) "23703JX30A"  ["total"]=  string(2) "30"}array(3) {  ["stock_no"]=  string(13) "SU13061301016"  ["cust_no"]=  string(10) "23703EX80A"  ["total"]=  string(3) "105"}array(3) {  ["stock_no"]=  string(13) "SU13061301016"  ["cust_no"]=  string(10) "23703EX80A"  ["total"]=  string(3) "120"}array(3) {  ["stock_no"]=  string(13) "SU13061301033"  ["cust_no"]=  string(10) "237033AW0A"  ["total"]=  string(3) "210"}array(3) {  ["stock_no"]=  string(13) "SU13061301032"  ["cust_no"]=  string(10) "237033AW0A"  ["total"]=  string(3) "255"}*/
Copy after login

求按照先入先出的规则,入库信息对应出库要求的结果。 注:字段total是已知对应的lotno的数量。

这不还是一样吗?
就你给出的两组数据,除了你以外,谁能知道谁是谁?

这不还是一样吗?
就你给出的两组数据,除了你以外,谁能知道谁是谁?
如果用数据库的联合查询,能匹配其关系,但是不能指定数量,这样写行吗?

select c.stock_no,a.packageno,a.lotno from vp_barcode_2d_y as a left joinkw_manage as b on a.packageno = b.packageno left join stock_detail as c on b.cust_no = concat(left(c.cust_no,5),' ',right(c.cust_no,5))where c.stock_no = 'SU13061301011' group by a.barcode order by a.lotno,a.packageno asc 样式如下:== 转存表中的数据 vp_barcode_2d_y |SU13061301011|VP3.0 130219001|3207|SU13061301011|VP3.0 130219001|3207|SU13061301011|VP3.0 130219001|3207|SU13061301011|VP3.0 130219001|3207|SU13061301011|VP3.0 130219001|3207|SU13061301011|VP3.0 130219001|3207|SU13061301011|VP3.0 130219001|3207|SU13061301011|VP3.0 130219001|3207|SU13061301011|VP3.0 130219001|3207|SU13061301011|VP3.0 130219001|3207|SU13061301011|VP3.0 130219001|3207|SU13061301011|VP3.0 130219001|3207|SU13061301011|VP3.0 130219001|3207|SU13061301011|VP3.0 130219001|3207|SU13061301011|VP3.0 130219001|3207|SU13061301011|VP3.0 130219002|3207|SU13061301011|VP3.0 130219002|3207|SU13061301011|VP3.0 130219002|3207|SU13061301011|VP3.0 130219002|3207|SU13061301011|VP3.0 130219002|3207|SU13061301011|VP3.0 130219002|3207|SU13061301011|VP3.0 130219002|3207|SU13061301011|VP3.0 130219002|3207|SU13061301011|VP3.0 130219002|3207|SU13061301011|VP3.0 130219002|3207|SU13061301011|VP3.0 130219002|3207|SU13061301011|VP3.0 130219002|3207|SU13061301011|VP3.0 130219002|3207|SU13061301011|VP3.0 130219002|3207|SU13061301011|VP3.0 130219002|3207|SU13061301011|VP3.0 130219003|3207|SU13061301011|VP3.0 130219003|3207|SU13061301011|VP3.0 130219003|3207|SU13061301011|VP3.0 130219003|3207|SU13061301011|VP3.0 130219003|3207|SU13061301011|VP3.0 130219003|3207|SU13061301011|VP3.0 130219003|3207|SU13061301011|VP3.0 130219003|3207|SU13061301011|VP3.0 130219003|3207|SU13061301011|VP3.0 130219003|3207|SU13061301011|VP3.0 130219003|3207|SU13061301011|VP3.0 130219003|3207|SU13061301011|VP3.0 130219003|3207|SU13061301011|VP3.0 130219003|3207|SU13061301011|VP3.0 130219003|3207....//得到的结果是:显示行 0 - 29 (540 总计, 查询花费 0.0072 秒)
Copy after login

这不还是一样吗?
就你给出的两组数据,除了你以外,谁能知道谁是谁?
能不能这样处理?我已知stock_no的值,只要求得它对应的数量值(mount*snp的结果),再通过对应的数量值的结果去入库数据里按照先入先出的顺序匹配对应的lotno。按照这个表去匹配:

select a.packageno,a.lotno from vp_barcode_2d_y as a left joinkw_manage as b on a.packageno = b.packageno left join stock_detail as c on b.cust_no = concat(left(c.cust_no,5),' ',right(c.cust_no,5))where c.stock_no = 'SU13061301011' group by a.barcode order by a.lotno,a.packageno asc 样式如下:== 转存表中的数据 vp_barcode_2d_y |VP3.0 130219001|3207|VP3.0 130219001|3207|VP3.0 130219001|3207|VP3.0 130219001|3207|VP3.0 130219001|3207|VP3.0 130219001|3207|VP3.0 130219001|3207|VP3.0 130219001|3207|VP3.0 130219001|3207|VP3.0 130219001|3207|VP3.0 130219001|3207|VP3.0 130219001|3207|VP3.0 130219001|3207|VP3.0 130219001|3207|VP3.0 130219001|3207|VP3.0 130219002|3207|VP3.0 130219002|3207|VP3.0 130219002|3207|VP3.0 130219002|3207|VP3.0 130219002|3207|VP3.0 130219002|3207|VP3.0 130219002|3207|VP3.0 130219002|3207|VP3.0 130219002|3207|VP3.0 130219002|3207|VP3.0 130219002|3207|VP3.0 130219002|3207|VP3.0 130219002|3207|VP3.0 130219002|3207|VP3.0 130219002|3207|VP3.0 130219003|3207|VP3.0 130219003|3207|VP3.0 130219003|3207|VP3.0 130219003|3207|VP3.0 130219003|3207|VP3.0 130219003|3207|VP3.0 130219003|3207|VP3.0 130219003|3207|VP3.0 130219003|3207|VP3.0 130219003|3207|VP3.0 130219003|3207|VP3.0 130219003|3207|VP3.0 130219003|3207|VP3.0 130219003|3207|VP3.0 130219003|3207....//得到的结果是:显示行 0 - 29 (540 总计, 查询花费 0.0072 秒)
Copy after login

库存表增加一个出库字段
入库时该字段为0
出库时该字段为已出库数量
入库数量 - 出库数量 = 该批次剩余数量


设 select * from tbl_name

id  num  1   20    2   20    3   30   
Copy after login
Copy after login
Copy after login

SELECT * , (SELECT sum( num ) FROM tbl_name WHERE id<=a.id ) as c FROM tbl_name a
id  num  c  1   20   20 2   20   40 3   30   70
Copy after login
Copy after login
Copy after login
则 c 列可做为出库来源的依据
如果出库包装的规模为 30
那么对应的id为:
包装1 1,2
包装2 2,3
包装3 3,后续id

库存表增加一个出库字段
入库时该字段为0
出库时该字段为已出库数量
入库数量 - 出库数量 = 该批次剩余数量


设 select * from tbl_name

id  num  1   20    2   20    3   30   
Copy after login
Copy after login
Copy after login

SELECT * , (SELECT sum( num ) FROM tbl_name WHERE id<=a.id ) as c FROM tbl_name a
id  num  c  1   20   20 2   20   40 3   30   70
Copy after login
Copy after login
Copy after login
则 c 列可做为出库来源的依据
如果出库包装的规模为 30
那么对应的id为:
包装1 1,2
包装2 2,3
包装3 3,后续id
好像有那么个意思了。看来还是数据库的设计问题。
新建的那张表是不是代表出货包装规格?那么C列代表是什么意思?

c列表示的是在以id排序的方向上,累加到当前记录的 num 列的和
id=1 20
id=2 20+20=40
id=3 20+20+30=70

库存表增加一个出库字段
入库时该字段为0
出库时该字段为已出库数量
入库数量 - 出库数量 = 该批次剩余数量


设 select * from tbl_name

id  num  1   20    2   20    3   30   
Copy after login
Copy after login
Copy after login

SELECT * , (SELECT sum( num ) FROM tbl_name WHERE id<=a.id ) as c FROM tbl_name a
id  num  c  1   20   20 2   20   40 3   30   70
Copy after login
Copy after login
Copy after login
则 c 列可做为出库来源的依据
如果出库包装的规模为 30
那么对应的id为:
包装1 1,2
包装2 2,3
包装3 3,后续id
我还有一个问题,虽然增加了这个出库数量字段,我怎么判断是哪个packageno出库?

这就需要编程处理了,毕竟在查询时是无法把一条记录拆成两条记录的

这就需要编程处理了,毕竟在查询时是无法把一条记录拆成两条记录的
像这样,入库的packageno对应的lotno批次及数量,导出了结果:

$sql = "select a.packageno,b.cust_no,b.lotno,count(b.lotno) from `kw_manage` as a left join `vp_barcode_2d_y` as b on a.packageno = b.packageno group by b.lotno,a.packageno order by b.lotno,a.packageno asc";$result = mysql_query($sql);while($row = mysql_fetch_array($result,MYSQL_ASSOC)){    var_dump($row);}结果:array(4) {  ["packageno"]=>  string(15) "VP3.0 130219001"  ["cust_no"]=>  string(11) "23703 3AW0A"  ["lotno"]=>  string(4) "3207"  ["count(b.lotno)"]=>  string(2) "15"}array(4) {  ["packageno"]=>  string(15) "VP3.0 130219002"  ["cust_no"]=>  string(11) "23703 3AW0A"  ["lotno"]=>  string(4) "3207"  ["count(b.lotno)"]=>  string(2) "15"}array(4) {  ["packageno"]=>  string(15) "VP3.0 130219003"  ["cust_no"]=>  string(11) "23703 3AW0A"  ["lotno"]=>  string(4) "3207"  ["count(b.lotno)"]=>  string(2) "15"}array(4) {  ["packageno"]=>  string(15) "VP3.0 130219004"  ["cust_no"]=>  string(11) "23703 3AW0A"  ["lotno"]=>  string(4) "3207"  ["count(b.lotno)"]=>  string(2) "15"}array(4) {  ["packageno"]=>  string(15) "VP3.0 130219005"  ["cust_no"]=>  string(11) "23703 3AW0A"  ["lotno"]=>  string(4) "3207"  ["count(b.lotno)"]=>  string(2) "15"}array(4) {  ["packageno"]=>  string(15) "VP3.0 130219006"  ["cust_no"]=>  string(11) "23703 3AW0A"  ["lotno"]=>  string(4) "3207"  ["count(b.lotno)"]=>  string(2) "15"}array(4) {  ["packageno"]=>  string(15) "VP3.0 130219007"  ["cust_no"]=>  string(11) "23703 3AW0A"  ["lotno"]=>  string(4) "3207"  ["count(b.lotno)"]=>  string(2) "15"}array(4) {  ["packageno"]=>  string(15) "VP3.0 130219008"  ["cust_no"]=>  string(11) "23703 3AW0A"  ["lotno"]=>  string(4) "3207"  ["count(b.lotno)"]=>  string(2) "15"}array(4) {  ["packageno"]=>  string(15) "VP3.0 130219009"  ["cust_no"]=>  string(11) "23703 3AW0A"  ["lotno"]=>  string(4) "3207"  ["count(b.lotno)"]=>  string(2) "15"}array(4) {  ["packageno"]=>  string(15) "VP3.0 130219010"  ["cust_no"]=>  string(11) "23703 3AW0A"  ["lotno"]=>  string(4) "3207"  ["count(b.lotno)"]=>  string(2) "15"}array(4) {  ["packageno"]=>  string(15) "VP3.0 130219011"  ["cust_no"]=>  string(11) "23703 3AW0A"  ["lotno"]=>  string(4) "3207"  ["count(b.lotno)"]=>  string(2) "15"}array(4) {  ["packageno"]=>  string(15) "VP3.0 130219012"  ["cust_no"]=>  string(11) "23703 3AW0A"  ["lotno"]=>  string(4) "3207"  ["count(b.lotno)"]=>  string(2) "15"}array(4) {  ["packageno"]=>  string(15) "VP3.0 130219013"  ["cust_no"]=>  string(11) "23703 3AW0A"  ["lotno"]=>  string(4) "3207"  ["count(b.lotno)"]=>  string(2) "15"}array(4) {  ["packageno"]=>  string(15) "VP3.0 130219014"  ["cust_no"]=>  string(11) "23703 3AW0A"  ["lotno"]=>  string(4) "3207"  ["count(b.lotno)"]=>  string(2) "15"}array(4) {  ["packageno"]=>  string(15) "VP3.0 130219015"  ["cust_no"]=>  string(11) "23703 3AW0A"  ["lotno"]=>  string(4) "3207"  ["count(b.lotno)"]=>  string(2) "15"}array(4) {  ["packageno"]=>  string(15) "VP3.0 130219016"  ["cust_no"]=>  string(11) "23703 3AW0A"  ["lotno"]=>  string(4) "3207"  ["count(b.lotno)"]=>  string(2) "15"}array(4) {  ["packageno"]=>  string(15) "VP3.0 130219017"  ["cust_no"]=>  string(11) "23703 3AW0A"  ["lotno"]=>  string(4) "3207"  ["count(b.lotno)"]=>  string(2) "15"}array(4) {  ["packageno"]=>  string(15) "VP3.0 130219018"  ["cust_no"]=>  string(11) "23703 3AW0A"  ["lotno"]=>  string(4) "3207"  ["count(b.lotno)"]=>  string(2) "15"}array(4) {  ["packageno"]=>  string(15) "VP3.0 130219019"  ["cust_no"]=>  string(11) "23703 3AW0A"  ["lotno"]=>  string(4) "3207"  ["count(b.lotno)"]=>  string(2) "15"}array(4) {  ["packageno"]=>  string(15) "VP3.0 130219020"  ["cust_no"]=>  string(11) "23703 3AW0A"  ["lotno"]=>  string(4) "3207"  ["count(b.lotno)"]=>  string(2) "15"}array(4) {  ["packageno"]=>  string(15) "VP3.0 130219021"  ["cust_no"]=>  string(11) "23703 3AW0A"  ["lotno"]=>  string(4) "3207"  ["count(b.lotno)"]=>  string(2) "15"}array(4) {  ["packageno"]=>  string(15) "VP3.0 130219022"  ["cust_no"]=>  string(11) "23703 3AW0A"  ["lotno"]=>  string(4) "3207"  ["count(b.lotno)"]=>  string(2) "15"}array(4) {  ["packageno"]=>  string(15) "VP3.0 130219023"  ["cust_no"]=>  string(11) "23703 3AW0A"  ["lotno"]=>  string(4) "3207"  ["count(b.lotno)"]=>  string(2) "15"}array(4) {  ["packageno"]=>  string(15) "VP3.0 130219024"  ["cust_no"]=>  string(11) "23703 3AW0A"  ["lotno"]=>  string(4) "3207"  ["count(b.lotno)"]=>  string(2) "15"}array(4) {  ["packageno"]=>  string(15) "VP3.0 130219048"  ["cust_no"]=>  string(11) "23710 JE22A"  ["lotno"]=>  string(4) "3207"  ["count(b.lotno)"]=>  string(2) "15"}array(4) {  ["packageno"]=>  string(15) "VP3.0 130219049"  ["cust_no"]=>  string(11) "23710 JE22A"  ["lotno"]=>  string(4) "3207"  ["count(b.lotno)"]=>  string(2) "15"}array(4) {  ["packageno"]=>  string(15) "VP3.0 130219050"  ["cust_no"]=>  string(11) "23710 JE22A"  ["lotno"]=>  string(4) "3207"  ["count(b.lotno)"]=>  string(2) "15"}array(4) {  ["packageno"]=>  string(15) "VP3.0 130219051"  ["cust_no"]=>  string(11) "23710 JE22A"  ["lotno"]=>  string(4) "3207"  ["count(b.lotno)"]=>  string(2) "15"}array(4) {  ["packageno"]=>  string(15) "VP3.0 130219052"  ["cust_no"]=>  string(11) "23710 JE22A"  ["lotno"]=>  string(4) "3207"  ["count(b.lotno)"]=>  string(2) "15"}array(4) {  ["packageno"]=>  string(15) "VP3.0 130219053"  ["cust_no"]=>  string(11) "23710 JE22A"  ["lotno"]=>  string(4) "3207"  ["count(b.lotno)"]=>  string(2) "15"}array(4) {  ["packageno"]=>  string(15) "VP3.0 130219054"  ["cust_no"]=>  string(11) "23710 JE22A"  ["lotno"]=>  string(4) "3207"  ["count(b.lotno)"]=>  string(2) "15"}array(4) {  ["packageno"]=>  string(15) "VP3.0 130219055"  ["cust_no"]=>  string(11) "23710 JE22A"  ["lotno"]=>  string(4) "3207"  ["count(b.lotno)"]=>  string(2) "15"}array(4) {  ["packageno"]=>  string(15) "VP3.0 130219107"  ["cust_no"]=>  string(11) "23703 3AW0A"  ["lotno"]=>  string(4) "3218"  ["count(b.lotno)"]=>  string(2) "15"}array(4) {  ["packageno"]=>  string(15) "VP3.0 130219108"  ["cust_no"]=>  string(11) "23703 3AW0A"  ["lotno"]=>  string(4) "3218"  ["count(b.lotno)"]=>  string(2) "15"}array(4) {  ["packageno"]=>  string(15) "VP3.0 130219109"  ["cust_no"]=>  string(11) "23703 3AW0A"  ["lotno"]=>  string(4) "3218"  ["count(b.lotno)"]=>  string(2) "15"}array(4) {  ["packageno"]=>  string(15) "VP3.0 130219110"  ["cust_no"]=>  string(11) "23703 3AW0A"  ["lotno"]=>  string(4) "3218"  ["count(b.lotno)"]=>  string(2) "15"}array(4) {  ["packageno"]=>  string(15) "VP3.0 130219111"  ["cust_no"]=>  string(11) "23703 3AW0A"  ["lotno"]=>  string(4) "3218"  ["count(b.lotno)"]=>  string(2) "15"}array(4) {  ["packageno"]=>  string(15) "VP3.0 130219112"  ["cust_no"]=>  string(11) "23703 3AW0A"  ["lotno"]=>  string(4) "3218"  ["count(b.lotno)"]=>  string(2) "15"}array(4) {  ["packageno"]=>  string(15) "VP3.0 130219113"  ["cust_no"]=>  string(11) "23703 3AW0A"  ["lotno"]=>  string(4) "3218"  ["count(b.lotno)"]=>  string(2) "15"}array(4) {  ["packageno"]=>  string(15) "VP3.0 130219114"  ["cust_no"]=>  string(11) "23703 3AW0A"  ["lotno"]=>  string(4) "3218"  ["count(b.lotno)"]=>  string(2) "15"}array(4) {  ["packageno"]=>  string(15) "VP3.0 130219115"  ["cust_no"]=>  string(11) "23703 3AW0A"  ["lotno"]=>  string(4) "3218"  ["count(b.lotno)"]=>  string(2) "15"}array(4) {  ["packageno"]=>  string(15) "VP3.0 130219116"  ["cust_no"]=>  string(11) "23703 3AW0A"  ["lotno"]=>  string(4) "3218"  ["count(b.lotno)"]=>  string(2) "15"}array(4) {  ["packageno"]=>  string(15) "VP3.0 130219117"  ["cust_no"]=>  string(11) "23703 3AW0A"  ["lotno"]=>  string(4) "3218"  ["count(b.lotno)"]=>  string(2) "15"}array(4) {  ["packageno"]=>  string(15) "VP3.0 130219118"  ["cust_no"]=>  string(11) "23703 3AW0A"  ["lotno"]=>  string(4) "3218"  ["count(b.lotno)"]=>  string(2) "15"}
Copy after login

已知stock_no为SU13061301011时的结果为195,195,这样的话怎么处理成为已知出库?
SELECT stock_no, mount*snp as total FROM `stock_detail` where `stock_no` = 'SU13061301011'CREATE TABLE IF NOT EXISTS `stock_detail` (  `ID` int(11) NOT NULL AUTO_INCREMENT,  `stock_no` varchar(20) NOT NULL,  `adress` varchar(10) NOT NULL,  `arr_time` datetime NOT NULL,  `c_type` varchar(20) NOT NULL,  `pu_no` varchar(20) NOT NULL,  `cust_no` varchar(20) NOT NULL,  `mount` int(10) NOT NULL,  `snp` int(10) NOT NULL,  `c1_time` datetime NOT NULL,  `c2_time` datetime NOT NULL,  PRIMARY KEY (`ID`)) ENGINE=InnoDB;---- 转存表中的数据 `stock_detail`--INSERT INTO `stock_detail` (`stock_no`, `snp`) VALUES('SU13061301011', 195),('SU13061301011', 195);
Copy after login

出库信息缺了cust_no,现在补上:

SELECT stock_no, cust_no,mount*snp as total FROM `stock_detail` where `stock_no` = 'SU13061301011'
Copy after login

输出结果:
array(3) {  ["stock_no"]=>  string(13) "SU13061301011"  ["cust_no"]=>  string(10) "237033AW0A"  ["total"]=>  string(3) "195"}array(3) {  ["stock_no"]=>  string(13) "SU13061301011"  ["cust_no"]=>  string(10) "237033AW0A"  ["total"]=>  string(3) "195"}
Copy after login

又在贴只有你自己才能看懂的数据

出库时有一个累加的过程,到达预设值就做断行处理
其实这个过程就是你最初帖子的问题,但你始终都以入库为基准,所以总是做不好
应该以出库为准:从A取n,不够再从B中取m,如此循环直到取够

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Working with Flash Session Data in Laravel Working with Flash Session Data in Laravel Mar 12, 2025 pm 05:08 PM

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-

PHP Logging: Best Practices for PHP Log Analysis PHP Logging: Best Practices for PHP Log Analysis Mar 10, 2025 pm 02:32 PM

PHP logging is essential for monitoring and debugging web applications, as well as capturing critical events, errors, and runtime behavior. It provides valuable insights into system performance, helps identify issues, and supports faster troubleshoot

cURL in PHP: How to Use the PHP cURL Extension in REST APIs cURL in PHP: How to Use the PHP cURL Extension in REST APIs Mar 14, 2025 am 11:42 AM

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.

Simplified HTTP Response Mocking in Laravel Tests Simplified HTTP Response Mocking in Laravel Tests Mar 12, 2025 pm 05:09 PM

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' =>

12 Best PHP Chat Scripts on CodeCanyon 12 Best PHP Chat Scripts on CodeCanyon Mar 13, 2025 pm 12:08 PM

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

Explain the concept of late static binding in PHP. Explain the concept of late static binding in PHP. Mar 21, 2025 pm 01:33 PM

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

Customizing/Extending Frameworks: How to add custom functionality. Customizing/Extending Frameworks: How to add custom functionality. Mar 28, 2025 pm 05:12 PM

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

See all articles