DmitrMakeev commited on
Commit
0c69a22
·
verified ·
1 Parent(s): 68a9cf5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -623,7 +623,7 @@ def shop_order_new():
623
 
624
 
625
 
626
-
627
  @app.route('/wr_order_vk_full', methods=['POST'])
628
  def write_order_vk_full():
629
  try:
@@ -642,8 +642,7 @@ def write_order_vk_full():
642
  order = request.form.get('order', '')
643
  status = request.form.get('status', '')
644
  del_flag = request.form.get('del', '')
645
- n_con_flag = request.form.get('n_con', '')
646
- chat_id = request.form.get('chat_id', '')
647
 
648
  if not email or not phone:
649
  logging.error("Email and phone are required")
@@ -655,7 +654,7 @@ def write_order_vk_full():
655
  cursor = conn.cursor()
656
 
657
  # Ищем по email, phone, vk_id или chat_id
658
- cursor.execute("SELECT * FROM contacts WHERE email = ? OR phone = ? OR vk_id = ? OR chat_id = ?", (email, phone, vkid, chat_id))
659
  result = cursor.fetchone()
660
 
661
  if result:
@@ -678,8 +677,8 @@ def write_order_vk_full():
678
  msk_now = utc_now.replace(tzinfo=pytz.utc).astimezone(msk_tz)
679
  data_on = msk_now.strftime('%Y-%m-%d %H:%M:%S')
680
 
681
- columns_to_update = ['name', 'phone', 'email', 'vk_id', 'chat_id', 'orders', 'n_con', 'data_on']
682
- values_to_update = [name, phone, email, vkid, chat_id, shop_st_json, n_con_flag, data_on]
683
 
684
  if result:
685
  set_clause = ', '.join([f"{col} = ?" for col in columns_to_update])
 
623
 
624
 
625
 
626
+ # Работа из VK_ID_full
627
  @app.route('/wr_order_vk_full', methods=['POST'])
628
  def write_order_vk_full():
629
  try:
 
642
  order = request.form.get('order', '')
643
  status = request.form.get('status', '')
644
  del_flag = request.form.get('del', '')
645
+
 
646
 
647
  if not email or not phone:
648
  logging.error("Email and phone are required")
 
654
  cursor = conn.cursor()
655
 
656
  # Ищем по email, phone, vk_id или chat_id
657
+ cursor.execute("SELECT * FROM contacts WHERE email = ? OR phone = ? OR vk_id = ? OR chat_id = ?", (email, phone, vkid))
658
  result = cursor.fetchone()
659
 
660
  if result:
 
677
  msk_now = utc_now.replace(tzinfo=pytz.utc).astimezone(msk_tz)
678
  data_on = msk_now.strftime('%Y-%m-%d %H:%M:%S')
679
 
680
+ columns_to_update = ['name', 'phone', 'email', 'vk_id', 'orders', 'data_on']
681
+ values_to_update = [name, phone, email, vkid, shop_st_json, data_on]
682
 
683
  if result:
684
  set_clause = ', '.join([f"{col} = ?" for col in columns_to_update])