сценарии написаны laravel DB::insert()
Методом QueryBuilder. Я застрял и подчеркнул эту ошибку. Я изо всех сил пытался отладить и искал столбец bigInt, и я думаю, это выглядит хорошо. Я не могу понять, в чем ошибка. Итак, надеюсь, что вы, ребята, сможете помочь.
Illuminate\Database\QueryException : SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for type bigint: "" (SQL: insert into "wo_positions" ("account_number", "bade", "branch_code", "cif", "currency", "customer", "date", "division_code", "kurs", "margin_bade", "opening_date", "penalty", "primary_bade", "product", "restruct_flag", "wo_date") values (7001437857, 1715495471, ID0010002, 75075876, IDR, MULTIPANEL INTERMITRA M, 2020-01-17, BBG2, 1, 223014412, 2018-12-13, 137239638, 1355241423, PDB0001, 1, 2020-01-17), (7001437857, 1633413981, ID0010002, 75075876, IDR, MULTIPANEL INTERMITRA M, 2020-04-06, BBG2, , 212343818, 2018-12-13, 130673119, 1290397045, PDB0001, 1, 2020-01-17))
вот дамп данных, которые я пытался передать.
array:4 [
0 => array:16 [
"date" => "2010-02-25"
"branch_code" => "ID0010008"
"cif" => "76985430"
"account_number" => "LD1715107884"
"customer" => "AWAY KANA CV"
"product" => "MUS0105"
"restruct_flag" => true
"primary_bade" => "140327913132"
"margin_bade" => "39547631275"
"penalty" => "24337003862"
"bade" => "304212548268"
"currency" => "IDR"
"kurs" => "1"
"opening_date" => "2007-02-26"
"wo_date" => "2009-02-18"
"division_code" => ""
]
1 => array:16 [
"date" => "2011-02-26"
"branch_code" => "ID0010008"
"cif" => "76985430"
"account_number" => "LD1715107885"
"customer" => "AWAY KANA CV"
"product" => "MUS0105"
"restruct_flag" => true
"primary_bade" => "340327913132"
"margin_bade" => "39547631275"
"penalty" => "24337003862"
"bade" => "304212548268"
"currency" => "IDR"
"kurs" => "1"
"opening_date" => "2007-02-26"
"wo_date" => "2009-02-26"
"division_code" => ""
]
2 => array:16 [
"date" => "2012-02-27"
"branch_code" => "ID0010008"
"cif" => "76985430"
"account_number" => "LD1715107886"
"customer" => "AWAY KANA CV"
"product" => "MUS0105"
"restruct_flag" => true
"primary_bade" => "20327913132"
"margin_bade" => "39547631275"
"penalty" => "24337003862"
"bade" => "304212548268"
"currency" => "IDR"
"kurs" => "1"
"opening_date" => "2007-02-26"
"wo_date" => "2009-02-27"
"division_code" => ""
]
3 => array:16 [
"date" => "2013-02-28"
"branch_code" => "ID0010008"
"cif" => "76985430"
"account_number" => "LD1715107887"
"customer" => "AWAY KANA CV"
"product" => "MUS0105"
"restruct_flag" => true
"primary_bade" => "5"
"margin_bade" => "39547631275"
"penalty" => "24337003862"
"bade" => "304212548268"
"currency" => "IDR"
"kurs" => "1"
"opening_date" => "2007-02-26"
"wo_date" => "2009-02-28"
"division_code" => ""
]
]
с этим, код будет похож это:
DB::table('wo_positions')->insert([
[
[
"date" => "2010-02-25"
"branch_code" => "ID0010008"
"cif" => "76985430"
"account_number" => "LD1715107884"
"customer" => "AWAY KANA CV"
"product" => "MUS0105"
"restruct_flag" => true
"primary_bade" => "140327913132"
"margin_bade" => "39547631275"
"penalty" => "24337003862"
"bade" => "304212548268"
"currency" => "IDR"
"kurs" => "1"
"opening_date" => "2007-02-26"
"wo_date" => "2009-02-18"
"division_code" => ""
],
[
"date" => "2011-02-26"
"branch_code" => "ID0010008"
"cif" => "76985430"
"account_number" => "LD1715107885"
"customer" => "AWAY KANA CV"
"product" => "MUS0105"
"restruct_flag" => true
"primary_bade" => "340327913132"
"margin_bade" => "39547631275"
"penalty" => "24337003862"
"bade" => "304212548268"
"currency" => "IDR"
"kurs" => "1"
"opening_date" => "2007-02-26"
"wo_date" => "2009-02-26"
"division_code" => ""
],
[
"date" => "2012-02-27"
"branch_code" => "ID0010008"
"cif" => "76985430"
"account_number" => "LD1715107886"
"customer" => "AWAY KANA CV"
"product" => "MUS0105"
"restruct_flag" => true
"primary_bade" => "20327913132"
"margin_bade" => "39547631275"
"penalty" => "24337003862"
"bade" => "304212548268"
"currency" => "IDR"
"kurs" => "1"
"opening_date" => "2007-02-26"
"wo_date" => "2009-02-27"
"division_code" => ""
]
,[
"date" => "2013-02-28"
"branch_code" => "ID0010008"
"cif" => "76985430"
"account_number" => "LD1715107887"
"customer" => "AWAY KANA CV"
"product" => "MUS0105"
"restruct_flag" => true
"primary_bade" => "5"
"margin_bade" => "39547631275"
"penalty" => "24337003862"
"bade" => "304212548268"
"currency" => "IDR"
"kurs" => "1"
"opening_date" => "2007-02-26"
"wo_date" => "2009-02-28"
"division_code" => ""
]
]);
это таблица схемы wo_positions
Table "public.wo_positions"
Column | Type | Collation | Nullable | Default
----------------+--------------------------------+-----------+----------+------------------------------------------
id | integer | | not null | nextval('wo_positions_id_seq'::regclass)
created_at | timestamp(0) without time zone | | not null | CURRENT_TIMESTAMP
updated_at | timestamp(0) without time zone | | not null | CURRENT_TIMESTAMP
division_code | character varying(255) | | |
wo_date | date | | |
opening_date | date | | |
kurs | bigint | | |
currency | character varying(255) | | |
bade | bigint | | |
penalty | bigint | | |
margin_bade | bigint | | |
primary_bade | bigint | | |
restruct_flag | boolean | | |
product | character varying(255) | | |
customer | character varying(255) | | |
account_number | character varying(255) | | |
cif | character varying(255) | | |
branch_code | character varying(255) | | |
date | date | | |
Indexes:
"wo_positions_pkey" PRIMARY KEY, btree (id)