InventoryForm.php 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601
  1. <?php
  2. /**
  3. * 重庆赤晓店信息科技有限公司
  4. * https://www.chixiaodian.com
  5. * Copyright (c) 2023 赤店商城 All rights reserved.
  6. */
  7. namespace app\modules\admin\models\agent\front_erp;
  8. use app\models\Admin;
  9. use app\models\AgentFrontBind;
  10. use app\models\AgentFrontErpCloudGoods;
  11. use app\models\AgentFrontErpInventory;
  12. use app\models\AgentFrontErpInventoryLog;
  13. //use app\models\ErpSupplier;
  14. use app\models\Goods;
  15. use app\models\Option;
  16. use app\constants\OptionSetting;
  17. use app\models\Order;
  18. use app\models\OrderDetail;
  19. use app\models\OrderTransit;
  20. use app\models\Supplier;
  21. use app\models\User;
  22. use app\models\SaasUser;
  23. use app\models\Warehouse;
  24. use app\models\WarehouseZone;
  25. class InventoryForm extends Model
  26. {
  27. public $front_agent_admin_id;
  28. public $id;
  29. public $ids;
  30. public $goods_name;
  31. public $supplier_name;
  32. public $goods_id;
  33. public $supplier_id;
  34. public $warehouse_id;
  35. public $warehouse_zone_id;
  36. public $is_delete;
  37. public $warning_num;
  38. public $eiId;
  39. public $nickname;
  40. public $phone;
  41. public $order_no;
  42. public $type;
  43. public function rules()
  44. {
  45. return [
  46. [['id', 'front_agent_admin_id', 'is_delete'], 'integer'],
  47. [['ids', 'goods_name', 'supplier_name'], 'string'],
  48. [['is_delete', 'goods_id', 'supplier_id', 'warehouse_id', 'warehouse_zone_id', 'warning_num', 'eiId', 'nickname', 'phone', 'order_no', 'type'], 'safe'],
  49. ];
  50. }
  51. public function init() {
  52. parent::init();
  53. if(empty($this->front_agent_admin_id)){
  54. $admin = get_admin();
  55. $this->front_agent_admin_id = 0;
  56. if ($admin->type === Admin::ADMIN_TYPE_FRONT_AGENT) {
  57. $this->front_agent_admin_id = $admin->id;
  58. }
  59. }
  60. }
  61. // public static function isOpen($store_id) {
  62. // $isOpen = Option::get(OptionSetting::ERP_OPEN, $store_id, 'store', 0)['value'];
  63. // return $isOpen;
  64. // }
  65. public static function initStoreGoods($front_agent_admin_id, $start_id = 0, $count = 10) {
  66. // if(!self::isOpen($store_id)){
  67. // return [
  68. // 'code' => 1,
  69. // 'msg' => '操作失败!功能未开启'
  70. // ];
  71. // }
  72. try {
  73. // if($start_id == 0 && cache_lock(__METHOD__ . $front_agent_admin_id, 86400 - time()%86400)){
  74. // return [
  75. // 'code' => 1,
  76. // 'msg' => '操作失败!提交太频繁,明天再试'
  77. // ];
  78. // }
  79. //获取仓库关联的供货商
  80. $supplier_arr = AgentFrontBind::getAgentFrontBindSupplierId($front_agent_admin_id);
  81. $supplier_str = implode(',', $supplier_arr);
  82. $goods_url = "/goods/getSupplierSendTypeGoods";
  83. $param = [
  84. 'send_type' => '5,6',
  85. 'supplier_id' => $supplier_str,
  86. 'fields' => 'id',
  87. 'page' => $start_id,
  88. 'limit' => $count
  89. ];
  90. //请求接口
  91. $domain = (new OptionSetting)->getCloudDomainName();
  92. $goodsIdList = cloud_post($domain . $goods_url, $param);
  93. $goodsIdList = json_decode($goodsIdList, true);
  94. if (intval($goodsIdList['code']) !== 0) {
  95. throw new \Exception('云仓商品获取失败');
  96. }
  97. if (empty($goodsIdList['data']['data'])) {
  98. throw new \Exception('云仓商品获取失败');
  99. }
  100. $goodsIdArr = array_column($goodsIdList['data']['data'], 'id');
  101. $errIds = [];
  102. foreach($goodsIdArr as $gid){
  103. // $start_id = $gid;
  104. $res = self::initGoods($front_agent_admin_id, $gid);
  105. if($res['code'] != 0){
  106. $errIds[] = $gid . $res['msg'];
  107. // return $res;
  108. }
  109. }
  110. $queue = 0;
  111. if(count($goodsIdArr) >= $count){
  112. $queue = queue_push(new \app\jobs\erp\AgentFrontErpInitStoreGoodsJob([
  113. 'front_agent_admin_id' => $front_agent_admin_id,
  114. 'id' => $start_id + 1,
  115. 'count' => 100,
  116. ]), 30, 1);
  117. }
  118. return [
  119. 'code' => 0,
  120. 'msg' => '操作成功!' . ($queue ? '数据较多,后台继续处理中' : ''),
  121. 'errIds' => $errIds,
  122. ];
  123. } catch (\Exception $e) {
  124. }
  125. }
  126. public static function filterGoods($goods) {
  127. if($goods['jst_goods_id']){
  128. return false;
  129. }
  130. if($goods['cloud_goods_id']){
  131. return false;
  132. }
  133. if($goods['md_food_id']){
  134. return false;
  135. }
  136. return true;
  137. }
  138. public static function initGoods($front_agent_admin_id, $goods) {
  139. $t = \Yii::$app->db->beginTransaction();
  140. try {
  141. // if(!($goods instanceof AgentFrontErpCloudGoods)){
  142. // $goods = AgentFrontErpCloudGoods::find()->where(['id' => $goods])->limit(1)->one();
  143. // }
  144. // if(!self::filterGoods($goods)){
  145. // throw new \Exception('非本地上传商品或无需进销存管理');
  146. // }
  147. //流程
  148. //获取仓库与云仓供货商绑定的商品列表 前端从获取的商品列表中进行导入到仓库
  149. //
  150. $goods_url = "/goods/getAttrParams";
  151. $param = [
  152. 'id' => $goods
  153. ];
  154. //请求接口
  155. $domain = (new OptionSetting)->getCloudDomainName();
  156. $goodsInfo = cloud_post($domain . $goods_url, $param);
  157. $goodsInfo = json_decode($goodsInfo, true);
  158. if (intval($goodsInfo['code']) !== 0) {
  159. throw new \Exception('云仓商品获取失败');
  160. }
  161. if (empty($goodsInfo['data'])) {
  162. throw new \Exception('云仓商品获取失败_');
  163. }
  164. if (!in_array($goodsInfo['data']['send_type'], [5, 6])) {
  165. throw new \Exception('非仓库配送产品,不能拉取');
  166. }
  167. $goods_supplier_id = $goodsInfo['data']['supplier_id'];
  168. if (!in_array($goods_supplier_id, AgentFrontBind::getAgentFrontBindSupplierId($front_agent_admin_id) ?? [])) {
  169. throw new \Exception('当前供货商商品未与仓库关联');
  170. }
  171. $goods = $goodsInfo['data'];
  172. $goods['attr'] = $goods['attrs'];
  173. Goods::skuAttr($goods);
  174. $agentFrontErpCloudGoods = AgentFrontErpCloudGoods::findOne(['cloud_goods_id' => $goods['id']]);
  175. if (!$agentFrontErpCloudGoods) {
  176. $agentFrontErpCloudGoods = new AgentFrontErpCloudGoods();
  177. $agentFrontErpCloudGoods->cloud_supplier_id = $goods_supplier_id;
  178. $agentFrontErpCloudGoods->cloud_goods_id = $goods['id'];
  179. }
  180. $agentFrontErpCloudGoods->goods_no = $goods['goods_no'];
  181. $agentFrontErpCloudGoods->goods_name = $goods['name'];
  182. $agentFrontErpCloudGoods->cover_pic = $goods['pic_url'];
  183. $agentFrontErpCloudGoods->attr = $goods['attr'];
  184. $agentFrontErpCloudGoods->status = $goods['status'];
  185. if (!$agentFrontErpCloudGoods->save()) {
  186. throw new \Exception('商品拉取失败');
  187. }
  188. $supplier = Supplier::findOne(['cloud_supplier_id' => $goods_supplier_id, 'is_delete' => 0]);
  189. $attr = json_decode($goods['attr'], true);
  190. foreach($attr as $item){
  191. if (isset($item['old_price'])) {
  192. $item['price'] = $item['old_price'];
  193. }
  194. if(!$item['attr_ids']){
  195. throw new \Exception('商品规格数据错误' . $goods['id'] . json_encode($attr));
  196. }
  197. $model = AgentFrontErpInventory::findOne(['goods_id' => $goods['id'], 'sku_id' => $item['cyy_skuId'], 'front_agent_admin_id' => $front_agent_admin_id]);
  198. if (empty($model)) {
  199. $model = new AgentFrontErpInventory();
  200. $model->front_agent_admin_id = $front_agent_admin_id;
  201. $model->goods_id = $goods['id'];
  202. $model->sku_id = $item['cyy_skuId'];
  203. $model->num = $item['num'];
  204. $model->attr_ids = $item['attr_ids'];
  205. $model->attr_info = json_encode($item, JSON_UNESCAPED_UNICODE);
  206. $model->goods_no = $item['no'];
  207. $model->supplier_id = $supplier->id ?? 0;
  208. $model->sync2Goods = 0;
  209. if (!$model->save()) {
  210. throw new \Exception(array_shift($model->getFirstErrors()));
  211. }
  212. }else{
  213. $attr_info = json_decode($model->attr_info, true);
  214. $model->goods_no = $item['no'];
  215. $model->attr_info = json_encode($item, JSON_UNESCAPED_UNICODE);
  216. $model->sync2Goods = 0;
  217. $model->supplier_id = $supplier->id ?? 0;
  218. if (!$model->save()) {
  219. throw new \Exception(array_shift($model->getFirstErrors()));
  220. }
  221. }
  222. }
  223. $t->commit();
  224. return [
  225. 'code' => 0,
  226. 'msg' => '操作成功!'
  227. ];
  228. } catch (\Exception $e) {
  229. $t->rollBack();
  230. \Yii::error($e);
  231. return [
  232. 'code' => 1,
  233. 'msg' => $e->getMessage()
  234. ];
  235. }
  236. }
  237. public static function afterGoodsSave($goods, $insert, $changedAttributes) {
  238. // if(!self::isOpen($goods['store_id'])){
  239. // return;
  240. // }
  241. if($insert || $changedAttributes['attr']){
  242. self::initGoods($goods['store_id'], $goods);
  243. }
  244. }
  245. // public static function erp2Goods($store_id, $goods) {
  246. // try{
  247. //// if(!self::isOpen($store_id)){
  248. //// return;
  249. //// }
  250. // if (intval($goods->is_front_delivery)) {
  251. // $list = AgentFrontErpInventory::findAll(['goods_id' => $goods->cloud_goods_id, 'is_delete' => 0]);
  252. // foreach($list as $item){
  253. // AgentFrontErpInventory::num2Goods($item['id']);
  254. // }
  255. // $list && $goods->refresh();
  256. // }
  257. //
  258. // } catch (\Exception $ex) {
  259. // \Yii::error($ex->getMessage());
  260. // }
  261. // }
  262. public static function afterOrderDetailSave($od) {
  263. try {
  264. // $order = $od->order;
  265. // $goods = $od->goods;
  266. //// if(!self::isOpen($order['store_id'])){
  267. //// return;
  268. //// }
  269. //
  270. // $goods_info = json_decode($od->goods_info, true);
  271. //
  272. // $goods_no = $goods_info['goods_no'];
  273. // if (!empty($goods_info)) {
  274. // $od_attr = json_decode($od['attr'], true);
  275. // $od_attr_id = array_column($od_attr, 'attr_id');
  276. // sort($od_attr_id);
  277. // foreach ($goods_info['attr'] as $goods_attr_item) {
  278. // $goods_attr_id = array_column($goods_attr_item['attr_list'], 'attr_id');
  279. // sort($goods_attr_id);
  280. //
  281. // if (!array_diff($goods_attr_id, $od_attr_id)) {
  282. // $goods_no = $goods_attr_item['no'];
  283. // }
  284. // }
  285. // }
  286. //
  287. //
  288. //// $skuId = Goods::skuid1($od['goods_id'], json_decode($od['attr'], true));
  289. // $ei = AgentFrontErpInventory::findOne(['goods_id' => $goods->cloud_goods_id, 'goods_no' => $goods_no]);
  290. // if($ei){
  291. // AgentFrontErpInventory::logSave($ei, -$od['num'], AgentFrontErpInventoryLog::LOG_TYPE_ORDER, $order->id, $order->order_no);
  292. // }
  293. } catch (\Exception $e) {
  294. \Yii::error($e);
  295. return [
  296. 'code' => 1,
  297. 'msg' => $e->getMessage()
  298. ];
  299. }
  300. }
  301. // public static function afterOrderSave($order, $insert, $changedAttributes) {
  302. // try {
  303. //// if(!self::isOpen($order['store_id'])){
  304. //// return;
  305. //// }
  306. // //恢复库存
  307. // if (!$insert && isset($changedAttributes['trade_status']) && $order->trade_status == Order::ORDER_FLOW_CANCEL) {
  308. // if(!cache_lock(__METHOD__ . $order->id, 60)){
  309. // $od = $order->detail;
  310. // foreach($od as $item){
  311. // $skuId = Goods::skuid1($item['goods_id'], json_decode($item['attr'], true));
  312. // $ei = AgentFrontErpInventory::findOne(['goods_id' => $item['goods_id'], 'sku_id' => $skuId]);
  313. // if($ei){
  314. // AgentFrontErpInventory::logSave($ei, $item['num'], AgentFrontErpInventoryLog::LOG_TYPE_ORDER, $order->id, $order->order_no);
  315. // }
  316. // }
  317. // }
  318. // }
  319. // } catch (\Exception $e) {
  320. // \Yii::error($e);
  321. // return [
  322. // 'code' => 1,
  323. // 'msg' => $e->getMessage()
  324. // ];
  325. // }
  326. // }
  327. public function warningList ()
  328. {
  329. $this->warning_num = ERP::getWarningNum($this->front_agent_admin_id);
  330. if (empty($this->supplier_id)) {
  331. return [
  332. 'code' => 1,
  333. 'msg' => '请选择供货商'
  334. ];
  335. }
  336. $_GET['pageSize'] = 300;
  337. return $this->search();
  338. }
  339. public function search ()
  340. {
  341. try {
  342. $query = AgentFrontErpInventory::find()->alias('ei')->where(['ei.is_delete' => 0, 'ei.front_agent_admin_id' => $this->front_agent_admin_id]);
  343. $query->leftJoin(['g' => AgentFrontErpCloudGoods::tableName()], 'g.cloud_goods_id = ei.goods_id');
  344. $query->leftJoin(['s' => Supplier::tableName()], 's.id = ei.supplier_id');
  345. // $query->leftJoin(['wh' => Warehouse::tableName()], 'wh.id = g.warehouse_id');
  346. // $query->leftJoin(['whz' => WarehouseZone::tableName()], 'whz.id = g.warehouse_zone_id');
  347. if (!empty($this->warning_num)) {
  348. $query->andWhere(['<', 'ei.num', $this->warning_num]);
  349. }
  350. if (!empty($this->goods_name)) {
  351. $query->andWhere(['like', 'g.goods_name', $this->goods_name]);
  352. }
  353. if (!empty($this->supplier_name)) {
  354. $query->andWhere(['ei.supplier_id' => Supplier::find()->select('id')->where(['like', 'supplier_name', $this->supplier_name])]);
  355. }
  356. if (!empty($this->supplier_id)) {
  357. $query->andWhere(['ei.supplier_id' => $this->supplier_id]);
  358. }
  359. if (!empty($this->goods_id)) {
  360. $query->andWhere(['ei.goods_id' => $this->goods_id]);
  361. }
  362. $query->orderBy('ei.goods_id DESC');
  363. $query->select('ei.*, g.goods_name, g.cover_pic, s.supplier_name');
  364. $pagination = pagination_make($query);
  365. foreach ($pagination['list'] as &$item) {
  366. // $item['created_at'] = date("Y-m-d H:i:s", $item['created_at']);
  367. $attr_info = json_decode($item['attr_info'], true);
  368. $item['attr_names'] = implode(',', array_column($attr_info['attr_list'], 'attr_name'));
  369. $item['price'] = $attr_info['price'];
  370. if($attr_info['pic']){
  371. $item['cover_pic'] = $attr_info['pic'];
  372. }
  373. $admin = Admin::findOne($item['front_agent_admin_id']);
  374. $item['warehouse_name'] = $admin->name ?: '';
  375. }
  376. return [
  377. 'code' => 0,
  378. 'msg' => 'success',
  379. 'data' => $pagination,
  380. // 'q' => $query->createCommand()->getRawSql(),
  381. ];
  382. } catch (\Exception $e) {
  383. \Yii::error($e);
  384. return [
  385. 'code' => 1,
  386. 'msg' => $e->getMessage()
  387. ];
  388. }
  389. }
  390. // 保存库存供货商信息 supplier_id为供货商表id 非云仓供货商id
  391. // public function saveSupplier ()
  392. // {
  393. // $t = \Yii::$app->db->beginTransaction();
  394. // try {
  395. // $front_agent_admin_id = $this->front_agent_admin_id;
  396. // $ids = explode(',', $this->id);
  397. //
  398. // $supplier = Supplier::findOne($this->supplier_id);
  399. // if (!$supplier) {
  400. // throw new \Exception('供货商信息不存在');
  401. // }
  402. //
  403. // foreach($ids as $id){
  404. // $model = AgentFrontErpInventory::findOne(['id' => $id, 'front_agent_admin_id' => $front_agent_admin_id]);
  405. // $model->supplier_id = $this->supplier_id;
  406. // if (!$model->save()) {
  407. // \Yii::error([__METHOD__, $model->attributes]);
  408. // throw new \Exception(array_shift($model->getFirstErrors()));
  409. // }
  410. // }
  411. // $t->commit();
  412. //
  413. //
  414. // $erpSupplier = Supplier::findOne($this->supplier_id);
  415. // $erp_supplier_name = $erpSupplier->name;
  416. //
  417. // return [
  418. // 'code' => 0,
  419. // 'msg' => '操作成功!',
  420. // 'data' => [
  421. // 'supplier_id' => $this->supplier_id,
  422. // 'erp_supplier_name' => $erp_supplier_name,
  423. // ]
  424. // ];
  425. // } catch (\Exception $e) {
  426. // \Yii::error($e);
  427. // $t->rollBack();
  428. // return [
  429. // 'code' => 1,
  430. // 'msg' => $e->getMessage()
  431. // ];
  432. // }
  433. // }
  434. public function saveKey ()
  435. {
  436. $t = \Yii::$app->db->beginTransaction();
  437. try {
  438. $model = AgentFrontErpInventory::findOne(['id' => $this->id, 'store_id' => $this->store_id]);
  439. if (empty($model)) {
  440. throw new \Exception('参数错误');
  441. }
  442. $key = $this->key;
  443. $model->$key = $this->val;
  444. if (!$model->save()) {
  445. \Yii::error([__METHOD__, $model->attributes]);
  446. throw new \Exception(array_shift($model->getFirstErrors()));
  447. }
  448. $t->commit();
  449. return [
  450. 'code' => 0,
  451. 'msg' => '操作成功!'
  452. ];
  453. } catch (\Exception $e) {
  454. \Yii::error($e);
  455. $t->rollBack();
  456. return [
  457. 'code' => 1,
  458. 'msg' => $e->getMessage()
  459. ];
  460. }
  461. }
  462. public function del ()
  463. {
  464. try {
  465. if ($this->ids) {
  466. $ids = explode(',', $this->ids);
  467. AgentFrontErpInventory::updateAll(['is_delete' => 1, 'deleted_at' => time()], ['and', ['in', 'id', $ids], ['store_id' => $this->store_id]]);
  468. }
  469. return [
  470. 'code' => 0,
  471. 'msg' => '操作成功!'
  472. ];
  473. } catch (\Exception $e) {
  474. \Yii::error($e);
  475. return [
  476. 'code' => 1,
  477. 'msg' => $e->getMessage()
  478. ];
  479. }
  480. }
  481. public function logList() {
  482. try {
  483. $query = AgentFrontErpInventoryLog::find()->alias('eil')
  484. ->leftJoin(['ei' => AgentFrontErpInventory::tableName()], 'ei.id = eil.inventory_id')
  485. ->where(['eil.is_delete' => 0, 'ei.front_agent_admin_id' => $this->front_agent_admin_id, 'ei.id' => $this->eiId]);
  486. $query->leftJoin(['ot' => OrderTransit::tableName()], 'ot.cloud_order_id = eil.order_id');
  487. $query->leftJoin(['o' => Order::tableName()], 'o.id = ot.order_id');
  488. $query->leftJoin(['u' => User::tableName()], 'o.user_id = u.id');
  489. $query->leftJoin(['su' => SaasUser::tableName()], 'u.binding = su.mobile');
  490. if(isset($this->type) && $this->type > -1){
  491. $query->andWhere(['eil.type' => $this->type]);
  492. }
  493. if($this->nickname || $this->phone){
  494. $query->andWhere(['eil.type' => AgentFrontErpInventoryLog::LOG_TYPE_ORDER]);
  495. $query->andWhere(['like', 'su.mobile', $this->phone]);
  496. $query->andWhere(['like', 'su.name', $this->nickname]);
  497. }
  498. if($this->order_no){
  499. $query->andWhere(['like', 'eil.order_no', $this->order_no]);
  500. }
  501. $query->orderBy('eil.id DESC');
  502. $query->select('eil.*, su.name, su.mobile, su.avatar, o.id store_order_id');
  503. $pagination = pagination_make($query);
  504. foreach ($pagination['list'] as &$item) {
  505. $item['created_at'] = date("Y-m-d H:i:s", $item['created_at']);
  506. if($item['type'] == AgentFrontErpInventoryLog::LOG_TYPE_PURCHASEIN){
  507. $item['name'] = '入库';
  508. }
  509. if($item['type'] == AgentFrontErpInventoryLog::LOG_TYPE_PURCHASEOUT){
  510. $item['name'] = '出库';
  511. }
  512. if($item['type'] == AgentFrontErpInventoryLog::LOG_TYPE_ORDER){
  513. $item['order_id'] = $item['store_order_id'];
  514. }
  515. }
  516. return [
  517. 'code' => 0,
  518. 'msg' => 'success',
  519. 'data' => $pagination,
  520. // 'q' => $query->createCommand()->getRawSql(),
  521. ];
  522. } catch (\Exception $e) {
  523. \Yii::error($e);
  524. return [
  525. 'code' => 1,
  526. 'msg' => $e->getMessage()
  527. ];
  528. }
  529. }
  530. public function getSupplierSendTypeGoods() {
  531. $front_agent_admin_id = $this->front_agent_admin_id;
  532. //获取仓库关联的供货商
  533. $supplier_arr = AgentFrontBind::getAgentFrontBindSupplierId($front_agent_admin_id);
  534. $supplier_str = implode(',', $supplier_arr);
  535. $goods_url = "/goods/getSupplierSendTypeGoods";
  536. $param = [
  537. 'send_type' => '5,6',
  538. 'supplier_id' => $supplier_str,
  539. 'fields' => 'id, name, price, num, pic_url',
  540. 'page' => input_params('pageNo'),
  541. 'limit' => 10,
  542. 'search_type' => 1,
  543. 'goods_name' => $this->goods_name
  544. ];
  545. //请求接口
  546. $domain = (new OptionSetting)->getCloudDomainName();
  547. $goodsIdList = cloud_post($domain . $goods_url, $param);
  548. return json_decode($goodsIdList, true);
  549. }
  550. }