Relation.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. namespace app\extra\dyMini;
  3. use app\extra\dyLife\BasicLife;
  4. use yzh52521\EasyHttp\Http;
  5. class Relation extends BasicLife
  6. {
  7. /**
  8. * 新增测试实体
  9. * @param array $goodsId
  10. * @return array
  11. */
  12. public function createTestRelation(array $goodsId = []): array
  13. {
  14. $param = [
  15. "operator" => "小谢",
  16. "ref_id_list" => $goodsId,
  17. "type" => "goods"
  18. ];
  19. return $this->curlPostApi("api/industry/v1/solution/add_app_test_relation/",$param);
  20. }
  21. public function getTestRelation(array $goodsId = []): array
  22. {
  23. $param = [
  24. "type" => "goods"
  25. ];
  26. return $this->curlPostApi("api/industry/v1/solution/query_app_test_relation/",$param,'ref_id_list');
  27. }
  28. /**
  29. * 预下单
  30. * @param array $data
  31. * @return array
  32. */
  33. public function createOrderFirst(array $data = []): array
  34. {
  35. $param = [
  36. "sku_list" => [
  37. [
  38. "quantity" => 1,
  39. "sku_id" => "424144008809807427",
  40. "sku_id_type" => 1,
  41. "price" => 1,
  42. "discount_amount" => 0,
  43. "goods_info" => [
  44. "date_rule" => "周一至周日可用",
  45. "goods_id" => "1865253598118939",
  46. "goods_id_type" => 1
  47. ]
  48. ]
  49. ],
  50. "total_amount" => 1,
  51. "discount_amount" => 0,
  52. "phone_num" => "13265000719",
  53. "contact_name" => "小谢",
  54. "extra" => "AL202605156234065268123",
  55. "open_id" => "_000KmfiVkio30K9VxoeLUUY3_hngEWcgR7u",
  56. "out_order_no" => "AL202605156234065268123",
  57. "order_entry_schema" => [
  58. "params" => ["order" => "AL202605156234065268123"],
  59. "path" => "pages/order/detail"
  60. ]
  61. ];
  62. return $this->curlPostApi("api/apps/trade/v2/order/create_order/",$param);
  63. }
  64. }