作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
好的,我们正在尝试建立一个中央站点来查看来自销售我们产品的多个供应商的数据。这些多个供应商使用不同的销售系统(确切地说是两个不同的系统),因此每个数据库看起来完全不同。我们与他们的数据库同步,因此数据位于我们的本地服务器上。我们有 3 家供应商使用一种系统,2 家供应商使用另一种系统。我们需要的是一种方法来找出结果以同样的方式返回给我们。
以下是两个系统的示例:
System-1
Customers =>[
id, firstname, lastname, address
],
Transactions =>[
id, cost, paid, customer_id
]
System2
Customers =>[
id, NAMEFIRST, NAMELAST, AddressNumber, AddressString, AddressZip
],
Transactions=>[
id, COST, PAID, CUSTOMER_ID
]
我根本无法更改数据库。我希望能够回显 $this->Transaction->address 无论是哪个数据库。这可能吗?
最佳答案
您可以使用实体属性访问器:http://book.cakephp.org/3.0/en/orm/entities.html#accessors-mutators
class Customer extends Entity {
protected function _getFirstname($name) {
if ($name === null && isset($this->NAMEFIRST)) {
return $this->NAMEFIRST;
}
return $name;
}
}
关于php - Cakephp3将多个Mysql表标准化为1个模型表/实体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25706340/
出于好奇,我尝试了一些原型(prototype)制作,但似乎只允许在第一个位置使用子例程的原型(prototype) &。 当我写作时 sub test (&$$) { do_somethin
我需要开发一个类似于 Android Play 商店应用程序或类似 this app 的应用程序.我阅读了很多教程,发现几乎每个教程都有与 this one 类似的例子。 . 我已经开始使用我的应用程
考虑一个表示“事件之间的时间”的列: (5, 40, 3, 6, 0, 9, 0, 4, 5, 18, 2, 4, 3, 2) 我想将这些分组到 30 个桶中,但桶会重置。期望的结果: (0, 1,
我是一名优秀的程序员,十分优秀!