【发布时间】:2021-05-22 03:37:49
【问题描述】:
这里是初学者。我目前正在制作一个匹配系统,业主将在其中注册他们的条目。完成后,我将单击“匹配”按钮,它将生成匹配。 匹配的逻辑取决于权重。
例如,如果 owner 1 和 owner 2 注册了一个有 1900 重量的条目,他们将 自动匹配。 (如第二张表所示)
我怎样才能实现我的这些目标?提前谢谢你们。
tbl_entry
|id| entryName| lightBand| weight |
|---| --------| ----- |---------|
| 1 | owner1 | 1 | 1900 |
| 2 | owner1 | 2 | 1920 |
| 3 | owner2 | 3 | 1900 |
| 4 | owner3 | 4 | 1910 |
| 5 | owner4 | 5 | 1910 |
tbl_matching
| id |fightID| entryName| lightBand| weight | entryName| lightband1| weight1|
|---- |--------| --------| ----- |---------|-------- |----------|--------|
| 1 | 1 | owner1 | 1 | 1900 | owner2 | 3 | 1900 |
| 2 | 2 | owner3 | 4 | 1910 | owner4 | 5 | 1910 |
| 3 | - | owner2 | - | - | - | - | - |
HTML:
<form action="transaction/match" method="POST">
<input type="submit" name="doMatch"> match
</form>
控制器:
public function match {
$formSubmit = $this->input->post('doMatch');
// do the matching query here
}
- (连字符/破折号)
【问题讨论】:
标签: mysql codeigniter