try {
$check_id = create_guid_my("01", $order_id);
if (empty($seller_id)) $seller_id = "00000000-0000-0000-0000-000000000000";
- $check = new CreateChecks(['check_id' => $check_id, 'date' => date('Y-m-d H:i:s'), 'kkm_id' => $kkm_id, 'seller_id' => $seller_id, 'store_id' => $store_id, 'type' => "Продажа", 'order_id' => $order_id, 'items' => json_encode($products, JSON_UNESCAPED_UNICODE), 'payments' => json_encode($payments, JSON_UNESCAPED_UNICODE)]);
+ $check = new CreateChecks(['check_id' => $check_id, 'date' => date('Y-m-d H:i:s'), 'kkm_id' => $kkm_id, 'seller_id' => $seller_id, 'store_id' => $store_id, 'type' => "Продажа", 'order_id' => $order_id, 'items' => json_encode($products, JSON_UNESCAPED_UNICODE), 'payments' => json_encode($payments, JSON_UNESCAPED_UNICODE),'phone' => $row["phone"] ?? NULL]);
echo "<h1>Чек поставлен в очередь на пробитие в 1с $check_id</h1>";
} catch (Exception $e) {
[['kkm_id', 'store_id', 'order_id', 'check_id', 'guid', 'name', 'sales_check', 'items', 'payments', 'held', 'date', 'comments'], 'required'],
[['order_id', 'held', 'status'], 'integer'],
[['type', 'items', 'payments'], 'string'],
- [['date', 'delivery_date', 'date_up'], 'safe'],
+ [['date', 'delivery_date', 'date_up', 'phone'], 'safe'],
[['kkm_id', 'seller_id', 'store_id', 'check_id', 'guid', 'sales_check'], 'string', 'max' => 36],
+ [['phone'], 'string', 'max' => 25],
[['name', 'comments'], 'string', 'max' => 255],
[['order_id', 'check_id', 'type', 'date'], 'unique', 'targetAttribute' => ['order_id', 'check_id', 'type', 'date']],
];