Relation.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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" => 2,
  41. "price" => 100,
  42. "discount_amount" => 0,
  43. "goods_info" => [
  44. "date_rule" => "周一至周日可用",
  45. "goods_id" => "1865253598118939",
  46. "goods_id_type" => 1
  47. ]
  48. ]
  49. ],
  50. "app_id" => sConf('wechat.mini_appid'),
  51. "total_amount" => 1,
  52. "discount_amount" => 0,
  53. "phone_num" => "13265000719",
  54. "contact_name" => "谢",
  55. "extra" => "AL202605156234065268123",
  56. "open_id" => "_000KmfiVkio30K9VxoeLUUY3_hngEWcgR7u",
  57. "out_order_no" => "AL202605156234065268123",
  58. "order_entry_schema" => [
  59. "params" => json_encode(["order" => "AL202605156234065268123"]),
  60. "path" => "pages/order/detail"
  61. ]
  62. ];
  63. return $this->curlPostApi("api/apps/trade/v2/order/create_order/",$param);
  64. }
  65. }