匹配付款和订单PHP

时间:2014-04-30 17:08:53

标签: php mysql

我有2张表订单与付款

订单

+--------+-----------+------------+--------+
|   id   |   Order   |  SaleDate  | Amount |
+--------+-----------+------------+--------+
|   1    |        H1 | 2014-02-10 |    300 |
|   2    |        H2 | 2014-02-10 |    110 |
|   3    |        H3 | 2014-02-10 |   1015 |
|   4    |        H4 | 2014-02-10 |    225 |
|   5    |        H5 | 2014-02-10 |    125 |
|   6    |        H6 | 2014-02-10 |    256 |
|   7    |        H7 | 2014-02-10 |     87 |
+--------+-----------+------------+--------+

付款

+--------+------------+---------------+--------+
|   id   |  PayDate   | PaymentMethod | Amount |
+--------+------------+---------------+--------+
|   1    | 2014-02-10 | Cash          |    410 |
|   2    | 2014-02-10 | Cash          |    350 |
|   3    | 2014-02-10 | Check         |   1015 |
|   4    | 2014-02-10 | Credit Card   |    343 |
+--------+------------+---------------+--------+

我想匹配与不同订单金额相对应的付款金额

这可能吗?

此致

0 个答案:

没有答案