【发布时间】:2020-09-10 05:53:55
【问题描述】:
log table with product id product table 我的日志表包含具有 json 数据的数据字段,例如
{"product-id":"14","product-name":"test","product-url":"\/projects\/test\/products\/lecture-details\/8","product-type":"lecture","product-price":"0"}
我想使用存储在数据文件中的产品 ID 加入产品表。我该怎么做?
log table "product-id": "14" 此字段需要包含在产品表中。
$getQuery = $this->Log->find('all')->matching('Users', function ($q) { return $q->where(['Users.is_deleted' => 'n']);})->contain(['Users','Products'])->select(['user_id' => 'Users.id', 'username' => 'Users.username','fname' => 'Users.fname','lname' => 'Users.lname', 'email' => 'Users.email','view_date' => 'Log.dt_created_on','data' => 'Log.data'])->where($conditions);
【问题讨论】:
标签: cakephp cakephp-3.0