PHP 7.2
MariaDB 10.3.11
Laravel 5.5.45
https://github.com/beyondcode/laravel-vouchers/issues/10
我正在使用此包装。 vouchers
表内有一个字段data
这是存储数组/ json数据。
vouchers
字段类型内的data
表是TEXT
。
例如
{"customer_id":1,"customer_name":"Shiro","message":"Birthday Voucher"}
优惠券表:-
+-----+-----------+-----------------+----------+--------------------------------------------------------------------------+---------------------+---------------------+---------------------+
| id | code | model_type | model_id | data | expires_at | created_at | updated_at |
+-----+-----------+-----------------+----------+--------------------------------------------------------------------------+---------------------+---------------------+---------------------+
| 170 | 1111-1112 | App\VoucherType | 2 | {"customer_id":"1","customer_name":"Shiro","message":"Birthday Voucher"} | 2019-04-30 23:59:59 | 2019-03-20 04:58:12 | 2019-03-20 04:58:12 |
+-----+-----------+-----------------+----------+--------------------------------------------------------------------------+---------------------+---------------------+---------------------+
客户表
+------+----------------------------------------------+----------------------+
| id | user_name | email |
+------+----------------------------------------------+----------------------+
| 1 | AMAZON BEAUTY SUPPLY - BEAUTIFUL LADYGAGA HA | beautifyfu@gmail.com |
+------+----------------------------------------------+----------------------+
我想加入我的customers
表。
我尝试了https://github.com/ybr-nx/laravel-mariadb
,但仍然无法直接加入该表。
有什么想法如何使用json字段连接两个表和一个表?