From: Aleksey Filippov Date: Thu, 3 Oct 2024 13:45:50 +0000 (+0300) Subject: Добавление телефона в чек при создании его из ERP от AMO X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=f0ea6b4db3320bb1de7c43831deac7f7ba24214f;p=erp24_rep%2Fyii-erp24%2F.git Добавление телефона в чек при создании его из ERP от AMO --- diff --git a/erp24/controllers/OrdersController.php b/erp24/controllers/OrdersController.php index a563e261..25b6a491 100644 --- a/erp24/controllers/OrdersController.php +++ b/erp24/controllers/OrdersController.php @@ -321,7 +321,7 @@ class OrdersController extends Controller 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 "

Чек поставлен в очередь на пробитие в 1с $check_id

"; } catch (Exception $e) { diff --git a/erp24/records/CreateChecks.php b/erp24/records/CreateChecks.php index 37f45874..9e5c95d6 100644 --- a/erp24/records/CreateChecks.php +++ b/erp24/records/CreateChecks.php @@ -45,8 +45,9 @@ class CreateChecks extends \yii\db\ActiveRecord [['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']], ];