| 13:51:35.915 | 6.3 ms | SELECT | SELECT COUNT(*) FROM (SELECT r.*,
min(
CASE WHEN 1 = r.verify_type THEN (
CASE WHEN rvr.status = 0 THEN 1
WHEN rsvr.status = 0 THEN 2
ELSE 4 END
) ELSE (
CASE WHEN rvr.status = 0 AND r.next_verify_user = 1001 THEN 1
WHEN rsvr.status = 0 AND r.next_stop_verify_user = 1001 THEN 2
ELSE 4 END
)
END) AS need_verify_sort
FROM "a57be577deb434"."tbl_erp_sales_outbounds" "r" LEFT JOIN "a57be577deb434"."tbl_erp_sales_outbound_verify_rels" "rvr" ON rvr.erp_sales_outbound_id = r.id LEFT JOIN "a57be577deb434"."tbl_erp_sales_outbound_stop_verify_rels" "rsvr" ON rsvr.erp_sales_outbound_id = r.id LEFT JOIN "a57be577deb434"."tbl_erp_sales_outbound_products" "epop" ON epop.erp_sales_outbound_id = r.id LEFT JOIN "a57be577deb434"."tbl_products" "product" ON epop.product_id = product.id LEFT JOIN "a57be577deb434"."tbl_clients" "client" ON client.id = r.client_id LEFT JOIN "a57be577deb434"."tbl_erp_sales_outbound_spent_products" "spentProduct" ON "spentProduct"."erp_sales_outbound_id" = "r"."id" WHERE (("client"."sales_rep"=1001) OR ("r"."created_by"=1001) OR ("rvr"."user_id"=1001) OR ("r"."created_by" IN (1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, 1021, 1022, 1023, 1025, 1026, 1027, 1028, 1029, 1030, 5015, 5016, 5022, 5023, 5024, 5025, 5026, 5027, 5028, 5029, 5030, 5031, 5032, 5033, 5037, 5043, 5044, 5045, 5047, 5048, 5049, 5050, 5062, 5063, 5064, 5065, 5066, 5069, 5070, 5071, 5072, 5073, 5074, 5075, 5076, 5078, 5079, 5080, 5081, 5082, 5083, 5085, 5086, 5087, 5088, 5089, 5093, 5094, 5095, 5096, 5101, 5102, 5104, 5105, 5123, 5124, 5125, 5126, 5128, 5135, 5203, 5208, 5209, 5229, 5230, 5247, 5248, 5249, 5250, 5252, 5258, 5259, 5293, 5294, 5295, 5296, 5297, 5298, 5299, 5300, 5301, 5302, 5303, 5304, 5305, 5309, 5311, 5329, 5332, 5333, 5351, 5356, 5357, 5358, 5359, 5360, 5364, 5388, 5393, 5404, 5409, 5411, 5412, 5413, 5419, 5420, 5440, 5445, 5446, 5448, 5449, 5461, 5467, 5476, 5497, 5499, 5500))) AND (("r"."status" != 0) OR (("r"."status"=0) AND ("r"."created_by"=1001))) AND ("spentProduct"."erp_inventory_product_id" IN (SELECT "id" FROM "a57be577deb434"."tbl_erp_inventory_products" WHERE "erp_purchase_inbound_id"='222')) GROUP BY "r"."id" ORDER BY need_verify_sort asc, created_at DESC) "c" |
| 13:51:35.922 | 5.2 ms | SELECT | SELECT r.*,
min(
CASE WHEN 1 = r.verify_type THEN (
CASE WHEN rvr.status = 0 THEN 1
WHEN rsvr.status = 0 THEN 2
ELSE 4 END
) ELSE (
CASE WHEN rvr.status = 0 AND r.next_verify_user = 1001 THEN 1
WHEN rsvr.status = 0 AND r.next_stop_verify_user = 1001 THEN 2
ELSE 4 END
)
END) AS need_verify_sort
FROM "a57be577deb434"."tbl_erp_sales_outbounds" "r" LEFT JOIN "a57be577deb434"."tbl_erp_sales_outbound_verify_rels" "rvr" ON rvr.erp_sales_outbound_id = r.id LEFT JOIN "a57be577deb434"."tbl_erp_sales_outbound_stop_verify_rels" "rsvr" ON rsvr.erp_sales_outbound_id = r.id LEFT JOIN "a57be577deb434"."tbl_erp_sales_outbound_products" "epop" ON epop.erp_sales_outbound_id = r.id LEFT JOIN "a57be577deb434"."tbl_products" "product" ON epop.product_id = product.id LEFT JOIN "a57be577deb434"."tbl_clients" "client" ON client.id = r.client_id LEFT JOIN "a57be577deb434"."tbl_erp_sales_outbound_spent_products" "spentProduct" ON "spentProduct"."erp_sales_outbound_id" = "r"."id" WHERE (("client"."sales_rep"=1001) OR ("r"."created_by"=1001) OR ("rvr"."user_id"=1001) OR ("r"."created_by" IN (1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, 1021, 1022, 1023, 1025, 1026, 1027, 1028, 1029, 1030, 5015, 5016, 5022, 5023, 5024, 5025, 5026, 5027, 5028, 5029, 5030, 5031, 5032, 5033, 5037, 5043, 5044, 5045, 5047, 5048, 5049, 5050, 5062, 5063, 5064, 5065, 5066, 5069, 5070, 5071, 5072, 5073, 5074, 5075, 5076, 5078, 5079, 5080, 5081, 5082, 5083, 5085, 5086, 5087, 5088, 5089, 5093, 5094, 5095, 5096, 5101, 5102, 5104, 5105, 5123, 5124, 5125, 5126, 5128, 5135, 5203, 5208, 5209, 5229, 5230, 5247, 5248, 5249, 5250, 5252, 5258, 5259, 5293, 5294, 5295, 5296, 5297, 5298, 5299, 5300, 5301, 5302, 5303, 5304, 5305, 5309, 5311, 5329, 5332, 5333, 5351, 5356, 5357, 5358, 5359, 5360, 5364, 5388, 5393, 5404, 5409, 5411, 5412, 5413, 5419, 5420, 5440, 5445, 5446, 5448, 5449, 5461, 5467, 5476, 5497, 5499, 5500))) AND (("r"."status" != 0) OR (("r"."status"=0) AND ("r"."created_by"=1001))) AND ("spentProduct"."erp_inventory_product_id" IN (SELECT "id" FROM "a57be577deb434"."tbl_erp_inventory_products" WHERE "erp_purchase_inbound_id"='222')) GROUP BY "r"."id" ORDER BY need_verify_sort asc, created_at DESC LIMIT 20 |
| 13:51:36.009 | 2.0 ms | INSERT | INSERT INTO "global"."tbl_api_log" ("code", "schema", "user_id", "device_type", "url", "request", "response", "php_error", "time", "duration") VALUES (200, 'a57be577deb434', 1001, 5, 'vue/erp-sales-outbound/of-erp-purchase-inbound', '{"erp_purchase_inbound_id":"222","page":"1","web_access_token":"8xqSDHkpxFShwMjatgql1iJNjJHyfMBa"}', '{"code":2000,"result":{"list":[{"id":164,"serial_no":"XSCKD-20260715-00003","from_date":"","wrote_date":"2026-07-15","handler":1001,"erp_sales_order_id":1722,"client_id":982,"project_id":4187,"erp_store_id":1,"status":2,"erp_send_type_id":"","abstract":"","description":"\u6d4b\u8bd5","verify_type":2,"next_verify_user":"","next_stop_verify_user":"","verify_at":"2026-07-15 14:44:04","stop_at":"","refuse_description":"","is_resubmitted":false,"number":"4","amount":"1776","created_by":1001,"stop_description":"","outbound_status":false,"is_settle":false,"is_used":false,"created_at":"2026-07-15 14:43:30","updated_at":"2026-07-15 14:44:04","print_times":"","is_sales_order_ready":false,"need_verify_sort":4,"createdBy":{"id":1001,"key":1001,"name":"\u5218\u4eba\u8bda","sex":"M","department_id":4,"avatar":{"id":2,"user_id":1001,"name":"\/files\/cdn\/\/avatar\/e868e40f-1256-329e-9b1c-74e095049622.png"},"department":{"id":4,"key":4,"name":"\u603b\u7ecf\u7406"}},"handlerPerson":{"id":1001,"key":1001,"name":"\u5218\u4eba\u8bda","sex":"M","department_id":4,"avatar":{"id":2,"user_id":1001,"name":"\/files\/cdn\/\/avatar\/e868e40f-1256-329e-9b1c-74e095049622.png"},"department":{"id":4,"key":4,"name":"\u603b\u7ecf\u7406"}},"client":{"id":982,"key":982,"name":"\u4e2d\u56fd\u4fe1\u606f\u5b89\u5168\u7814\u7a76\u6240"},"project":{"id":4187,"key":4187,"name":"\u6d4b\u91c7\u8d2d\u9700\u6c42\u7edf\u8ba1","bargain_date":"2026-07-15","buildContract":{"id":4504,"key":4504,"name":"2026-07-15-001","from_project":4187,"erp_settle_amount":"0","erp_un_settle_amount":"2220"}},"erpSalesOutboundCarbonCopyRels":[],"erpSalesOutboundVerifyRels":[{"id":561,"erp_sales_outbound_id":164,"user_id":1001,"status":1,"description":"","verify_at":"2026-07-15 14:44:04","user":{"id":1001,"key":1001,"name":"\u5218\u4eba\u8bda","sex":"M","avatar":{"id":2,"user_id":1001,"name":"\/files\/cdn\/\/avatar\/e868e40f-1256-329e-9b1c-74e095049622.png"}}}],"lastErpSalesOutboundVerifyRel":{},"haveErpSalesOutboundVerifyRel":{"id":561,"erp_sales_outbound_id":164,"user_id":1001,"status":1,"description":"","verify_at":"2026-07-15 14:44:04"},"selfErpSalesOutboundVerifyRel":{},"attachmentRelationships":[],"files":[],"erpStore":{"id":1,"key":1,"name":"\u62d3\u5b9e\u4ed3\u5e93"},"erpSendType":"","erpSalesOutboundProducts":[{"id":465,"erp_sales_outbound_id":164,"erp_sales_order_id":1722,"erp_sales_order_product_id":2272,"erp_store_id":1,"product_id":2091,"description":"","outbound":"0","number":4,"amount":"444","total_amount":"1776.00","hardware_from":"","software_from":"","maintenance_from":"","hardware_to":"","software_to":"","maintenance_to":"","erpStore":{"id":1,"key":1,"name":"\u62d3\u5b9e\u4ed3\u5e93"},"product":{"id":2091,"name":"\u5bc6\u5c01\u7f50\u73bb\u7483\u74f6\u5b50","product_type":23,"product_component":195,"product_brand":134,"product_serie":"","product_misc":"","product_qa":"","pn":"","description":"","created_by":1013,"created_at":"2025-08-11 18:00:03","updated_at":"2026-07-15 14:44:04","pinyin_shortcut":"mfgblpz","product_unit":3,"is_renew":false,"in_out_at":"2026-07-15 14:44:04.453578+08","productType":{"id":23,"key":23,"name":"\u793c\u54c1"},"productComponent":{"id":195,"key":195,"name":"\u8425\u517b\u98df\u54c1\u6ecb\u8865"},"productBrand":{"id":134,"key":134,"name":"\u7b2c\u4e09\u65b9"},"productSerie":"","productUnit":{"id":3,"key":3,"name":"\u4e2a"},"erpInventoryCount":{"product_id":2091,"outbound":"14","number":"15","purchase_inbound":"5","gift_inbound":"0","sales_outbound":"4","overflow_inbound":"0","lost_outbound":"0","disassemble_inbound":"0","disassemble_spent_outbound":"0","sales_gift_outbound":"0","build_inbound":"0","build_spent_outbound":"0","transfer_inbound":"0","transfer_spent_outbound":"0","inventory":"1","avg_amount":"404.6650000000000000","avg_total_amount":"400.0000000000000000","amount":"800.00"}},"erpSalesOutboundSpentProducts":[{"id":560,"erp_sales_outbound_id":164,"erp_sales_outbound_product_id":465,"erp_inventory_product_id":554,"product_id":2091,"description":"","number":"4","amount":"444","total_amount":"1776","cancel_number":"","cancel_amount":"","cancel_total_amount":"","product":{"id":2091,"name":"\u5bc6\u5c01\u7f50\u73bb\u7483\u74f6\u5b50","product_type":23,"product_component":195,"product_brand":134,"product_serie":"","product_misc":"","product_qa":"","pn":"","description":"","created_by":1013,"created_at":"2025-08-11 18:00:03","updated_at":"2026-07-15 14:44:04","pinyin_shortcut":"mfgblpz","product_unit":3,"is_renew":false,"in_out_at":"2026-07-15 14:44:04.453578+08","productType":{"id":23,"key":23,"name":"\u793c\u54c1"},"productComponent":{"id":195,"key":195,"name":"\u8425\u517b\u98df\u54c1\u6ecb\u8865"},"productBrand":{"id":134,"key":134,"name":"\u7b2c\u4e09\u65b9"},"productSerie":"","productUnit":{"id":3,"key":3,"name":"\u4e2a"}},"erpSalesOutboundSpentProductSns":[],"spent":{"id":794,"erp_purchase_order_id":"","erp_purchase_inbound_id":"","erp_inventory_product_id":554,"wrote_date":"2026-07-15","actual_amount":"800","actual_total_amount":"3200","outbound":"4","amount":"444","total_amount":"1776","lost_outbound":"","erp_inventory_lost_product_id":"","erp_inventory_lost_id":"","erp_inventory_start_id":"","erp_inventory_build_id":"","build_spent_outbound":"","erp_inventory_build_spent_product_id":"","erp_inventory_build_spent_id":"","sales_outbound":"4","erp_sales_outbound_spent_product_id":560,"erp_sales_outbound_id":164,"erp_purchase_gift_id":"","sales_gift_outbound":"","erp_sales_gift_spent_product_id":"","erp_sales_gift_id":"","erp_inventory_disassemble_id":"","disassemble_spent_outbound":"","erp_inventory_disassemble_spent_product_id":"","erp_inventory_disassemble_spent_id":"","erp_inventory_overflow_id":"","erp_inventory_transfer_spent_id":"","erp_inventory_transfer_spent_product_id":"","transfer_spent_outbound":"","erpInventoryProduct":{"id":554,"product_id":2091,"erp_purchase_inbound_id":222,"erp_purchase_order_id":2225,"erp_purchase_inbound_product_id":446,"erp_purchase_order_product_id":"","erp_store_id":1,"wrote_date":"2026-07-15","number":"5","outbound":"4","inventory":"1","amount":"800","total_amount":"4000.00","actual_amount":"800","actual_total_amount":"800","is_build":false,"created_at":"2026-07-15 14:42:33","lost_outbound":"0","erp_inventory_start_id":"","erp_inventory_start_product_id":"","erp_inventory_build_id":"","erp_inventory_build_product_id":"","build_spent_outbound":"0","sales_outbound":"4","erp_purchase_gift_id":"","erp_purchase_gift_product_id":"","sales_gift_outbound":"0","erp_inventory_disassemble_id":"","erp_inventory_disassemble_product_id":"","disassemble_spent_outbound":"0","erp_inventory_overflow_id":"","erp_inventory_overflow_product_id":"","erp_inventory_transfer_id":"","erp_inventory_transfer_product_id":"","transfer_spent_outbound":"0","erpPurchaseInbound":{"id":222,"serial_no":"CGRKD-20260715-00004","from_date":"","wrote_date":"2026-07-15","handler":1001,"erp_purchase_order_id":2225,"supplier_id":45,"purchase_contract_id":4503,"erp_store_id":1,"status":2,"abstract":"","description":"","verify_type":2,"next_verify_user":"","next_stop_verify_user":"","verify_at":"2026-07-15 14:42:33","stop_at":"","cancel_at":"","refuse_description":"","is_resubmitted":false,"number":"5","amount":"4000","cancel_number":"","cancel_amount":"","created_by":1001,"stop_description":"","is_used":true,"is_settle":false,"created_at":"2026-07-15 14:42:16","updated_at":"2026-07-15 14:42:33","print_times":""},"erpPurchaseGift":{},"erpInventoryStart":{},"erpInventoryBuild":{},"erpInventoryDisassemble":{},"erpInventoryOverflow":{}}}}],"erpSalesOrderProduct":{"id":2272,"erp_sales_order_id":1722,"erp_store_id":"","product_id":2091,"description":"","number":"5","outbound":"4","amount":"444","total_amount":"2220","last_number":"","last_amount":"","last_total_amount":"","cost":"","total_cost":"","supplier_id":"","hardware_from":"","software_from":"","maintenance_from":"","hardware_to":"","software_to":"","maintenance_to":"","erpSalesOutboundProducts":[{"id":465,"erp_sales_outbound_id":164,"erp_sales_order_id":1722,"erp_sales_order_product_id":2272,"erp_store_id":1,"product_id":2091,"description":"","outbound":"0","number":"4","amount":"444","total_amount":"1776.00","hardware_from":"","software_from":"","maintenance_from":"","hardware_to":"","software_to":"","maintenance_to":"","erpSalesOutbound":{"id":164,"serial_no":"XSCKD-20260715-00003","from_date":"","wrote_date":"2026-07-15","handler":1001,"erp_sales_order_id":1722,"client_id":982,"project_id":4187,"erp_store_id":1,"status":2,"erp_send_type_id":"","abstract":"","description":"\u6d4b\u8bd5","verify_type":2,"next_verify_user":"","next_stop_verify_user":"","verify_at":"2026-07-15 14:44:04","stop_at":"","refuse_description":"","is_resubmitted":false,"number":"4","amount":"1776","created_by":1001,"stop_description":"","outbound_status":false,"is_settle":false,"is_used":false,"created_at":"2026-07-15 14:43:30","updated_at":"2026-07-15 14:44:04","print_times":"","is_sales_order_ready":false}}],"un_outbound":5,"un_outbound_amount":2220},"spent_total_amount":3200,"sns":[],"avg_spent_amount":800,"pct":-80.18}],"erpSalesOutboundStopVerifyRels":[],"lastErpSalesOutboundStopVerifyRel":{},"haveErpSalesOutboundStopVerifyRel":{},"selfErpSalesOutboundStopVerifyRel":{},"erpSalesOutboundSpentProducts":[{"id":560,"erp_sales_outbound_id":164,"erp_sales_outbound_product_id":465,"erp_inventory_product_id":554,"product_id":2091,"description":"","number":"4","amount":"444","total_amount":"1776","cancel_number":"","cancel_amount":"","cancel_total_amount":"","product":{"id":2091,"name":"\u5bc6\u5c01\u7f50\u73bb\u7483\u74f6\u5b50","product_type":23,"product_component":195,"product_brand":134,"product_serie":"","product_misc":"","product_qa":"","pn":"","description":"","created_by":1013,"created_at":"2025-08-11 18:00:03","updated_at":"2026-07-15 14:44:04","pinyin_shortcut":"mfgblpz","product_unit":3,"is_renew":false,"in_out_at":"2026-07-15 14:44:04.453578+08","productType":{"id":23,"key":23,"name":"\u793c\u54c1"},"productComponent":{"id":195,"key":195,"name":"\u8425\u517b\u98df\u54c1\u6ecb\u8865"},"productBrand":{"id":134,"key":134,"name":"\u7b2c\u4e09\u65b9"},"productSerie":"","productUnit":{"id":3,"key":3,"name":"\u4e2a"}}}],"commentCount":{"object_id":164,"comment":1},"unreadComments":{},"cost":3200,"profit":-1424,"profit_pct":-80.18,"unread":0,"can_update":false,"can_update_sn":true,"can_delete":false,"can_resubmit":false,"can_verify":false,"can_refuse":false,"can_stop":true,"can_stop_verify":false,"can_stop_refuse":false,"can_create_erp_sales_return":true,"bgcolor":"#4B7902","status_display":"\u5df2\u901a\u8fc7","can_view_product":true,"can_make_sales_order":true,"sales_order_ready_display":false,"sales_order_un_ready_display":true}],"can_create":true,"pagenation":{"totalcount":1,"thispage":1,"pagesize":20}},"status":1,"msg":[{"name":"success","success":"\u6210\u529f\u83b7\u53d6\u6570\u636e","error":""}],"mod":0,"ip":"114.244.130.25","ua":"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10.15; rv:152.0) Gecko\/20100101 Firefox\/152.0"}', FALSE, '2026-07-16 13:51:36', 144158208) RETURNING "id" |