PayorderBusiness.php 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562
  1. <?php
  2. namespace app\business;
  3. use Illuminate\Support\Arr;
  4. use support\Db;
  5. use support\Redis;
  6. use Throwable;
  7. use yzh52521\EasyHttp\Http;
  8. class PayorderBusiness
  9. {
  10. static private $url = "http://ximen-api.zhangsan16688.com/api/order";
  11. static private $apikey = 'B39Q56Pt1oASnJ3sLNpVc255YG1M7r9Z';
  12. static private $memberid = 600538;
  13. /**
  14. * @param array $param [
  15. * order_no
  16. * ]
  17. * @return array
  18. */
  19. static public function payment($order_no, $pay_bankcode, $money, $url = '')
  20. {
  21. if (empty($url)) {
  22. $url = getenv('WEB_HOST');
  23. }
  24. $arr = [
  25. 'amount' => $money,//金额,单位为元,精确到小数点后两位
  26. 'outOrderNum' => $order_no,//商户订单号
  27. 'mchNum' => self::$memberid,//商户号
  28. 'payType' => $pay_bankcode,//通道类型
  29. 'timestamp' => time(),//发送请求的时间戳
  30. 'notifyUrl' => getenv('API_HOST') . '/api/pay/payment_callback.html',//异步通知地址,支付成功后将支付成功消息以POST请求发送给这个网址
  31. ];
  32. $arr['sign'] = self::payMd5sign($arr);
  33. $arr['returnUrl'] = $url;
  34. $data = Http::post(self::$url, $arr)->array();
  35. return ['data' => $data, 'arr' => $arr];
  36. }
  37. static public function payMd5sign(array $param)
  38. {
  39. /* @对数组键进行ASCII码排序*/
  40. ksort($param);
  41. $arr = [];
  42. //将数组进行重组装
  43. foreach ($param as $k => $v) {
  44. if (!empty($v)) {
  45. $arr[] = $k . '=' . $v;
  46. }
  47. }
  48. //转换成字符串并且拼接上密钥
  49. $sign = implode('&', $arr) . '&key=' . self::$apikey;
  50. return strtoupper(md5($sign));
  51. }
  52. /** 生成订单号
  53. * @param array $param
  54. * @return int
  55. * @throws \Exception
  56. */
  57. static public function orderAdd(array $param)
  58. {
  59. try {
  60. $goods = Db::table('wa_goods')->where('id', $param['id'])->first();
  61. if (empty($goods)) {
  62. throw new \Exception('产品不存在!');
  63. }
  64. $payAisleData = Db::table('wa_pay_aisle')->where('characteristic', $param['pay_characteristic'])->first();
  65. if (empty($payAisleData)) {
  66. throw new \Exception('支付类型不存在!');
  67. }
  68. if ($goods->id == 88) {
  69. if (empty($param['money'])) {
  70. throw new \Exception('请输入充值金额!');
  71. }
  72. $money = $param['money'];
  73. } else {
  74. $money = bcmul($goods->pay_price, $param['num'], 2);
  75. }
  76. $characteristic = $payAisleData->characteristic;
  77. $pay_type = $payAisleData->type;
  78. $order_no = date('YmdHis') . mt_rand(1000, 9999);
  79. $payorderId = Db::table('wa_payorder')->insertGetId([
  80. 'goods_id' => $goods->id,
  81. 'goods_type' => $goods->type,
  82. 'user_id' => $param['user_data']['id'],
  83. 'order_no' => $order_no,
  84. 'pay_characteristic' => $characteristic,
  85. 'pay_type' => $pay_type,
  86. 'money' => $money,
  87. 'num' => $param['num'],
  88. 'name' => Arr::get($param, 'name', null),
  89. 'mobile' => Arr::get($param, 'mobile', null),
  90. 'number' => Arr::get($param, 'number', null),
  91. 'address' => Arr::get($param, 'address', null),
  92. 'binding_mobile' => Arr::get($param, 'binding_mobile', null),
  93. 'reservation_name' => Arr::get($param, 'reservation_name', null),
  94. 'reservation_mobile' => Arr::get($param, 'reservation_mobile', null),
  95. 'reservation_address' => Arr::get($param, 'reservation_address', null),
  96. 'account_number' => Arr::get($param, 'account_number', null),
  97. 'created_at' => date('Y-m-d H:i:s'),
  98. 'updated_at' => date('Y-m-d H:i:s'),
  99. ]);
  100. } catch (\Throwable $exception) {
  101. throw new \Exception($exception->getMessage());
  102. }
  103. return $payorderId;
  104. }
  105. /** 开通银行卡生成订单号
  106. * @param array $param
  107. * @return int
  108. * @throws \Exception
  109. */
  110. static public function CardorderAdd(array $param)
  111. {
  112. try {
  113. $goods = Db::table('wa_goods')->where('id', $param['id'])->first();
  114. if (empty($goods)) {
  115. throw new \Exception('产品不存在!');
  116. }
  117. $price_money = bcmul($goods->pay_price, $param['num']);
  118. if ($param['user_data']['money_one'] < $price_money) {
  119. throw new \Exception('华润财富余额不足!');
  120. }
  121. $payorderId = Db::table('wa_payorder')->insertGetId([
  122. 'goods_id' => $goods->id,
  123. 'goods_type' => $goods->type,
  124. 'user_id' => $param['user_data']['id'],
  125. 'order_no' => date('YmdHis') . mt_rand(1000, 9999),
  126. 'pay_characteristic' => 0,
  127. 'pay_type' => 0,
  128. 'is_pay' => 2,
  129. 'money' => $price_money,
  130. 'num' => 1,
  131. 'created_at' => date('Y-m-d H:i:s'),
  132. 'updated_at' => date('Y-m-d H:i:s'),
  133. ]);
  134. } catch (\Throwable $exception) {
  135. throw new \Exception($exception->getMessage());
  136. }
  137. return $payorderId;
  138. }
  139. /**提现
  140. * @return void
  141. */
  142. static public function tx_withdraw($param, $service_charge = '')
  143. {
  144. try {
  145. $payAisleData = Db::table('wa_pay_aisle')->where('characteristic', $param['pay_characteristic'])->first();
  146. if (empty($payAisleData)) {
  147. throw new \Exception('支付类型不存在!');
  148. }
  149. $payorderId = Db::table('wa_payorder')->insertGetId([
  150. 'goods_type' => 1001,
  151. 'user_id' => $param['user_data']['id'],
  152. 'order_no' => date('YmdHis') . mt_rand(1000, 9999),
  153. 'pay_characteristic' => $payAisleData->characteristic,
  154. 'pay_type' => $payAisleData->type,
  155. 'money' => bcmul($param['money'], $service_charge, 2),
  156. 'withdraw_money' => $param['money'],
  157. 'mold_type' => $param['mold'],
  158. 'created_at' => date('Y-m-d H:i:s'),
  159. 'updated_at' => date('Y-m-d H:i:s'),
  160. ]);
  161. } catch (\Throwable $exception) {
  162. throw new \Exception($exception->getMessage());
  163. }
  164. return $payorderId;
  165. }
  166. /** 购买原始股
  167. * @param $num
  168. * @param $user_id
  169. * @param $pay_characteristic
  170. * @return int
  171. * @throws \Exception
  172. */
  173. static public function orderAddInitialShare($num, $user_id, $pay_characteristic)
  174. {
  175. try {
  176. $wa_system = Db::table('wa_system')->first();
  177. $payAisleData = Db::table('wa_pay_aisle')->where('characteristic', $pay_characteristic)->first();
  178. if (empty($payAisleData)) {
  179. throw new \Exception('支付类型不存在!');
  180. }
  181. $payorderId = Db::table('wa_payorder')->insertGetId([
  182. 'goods_id' => 0,
  183. 'goods_type' => 10,
  184. 'user_id' => $user_id,
  185. 'order_no' => date('YmdHis') . mt_rand(1000, 9999),
  186. 'pay_characteristic' => $payAisleData->characteristic,
  187. 'pay_type' => $payAisleData->type,
  188. 'money' => bcmul($wa_system->money_five_value, $num, 2),
  189. 'num' => $num,
  190. 'created_at' => date('Y-m-d H:i:s'),
  191. 'updated_at' => date('Y-m-d H:i:s'),
  192. ]);
  193. } catch (\Throwable $exception) {
  194. throw new \Exception($exception->getMessage());
  195. }
  196. return $payorderId;
  197. }
  198. /** 提现回调
  199. * @param $data
  200. * @return void
  201. * @throws \Exception
  202. */
  203. static public function payorderJkjtx($data)
  204. {
  205. try {
  206. /** @var $bankCard 银行卡 */
  207. $bankCard = Db::table('wa_bank_card')->where('uid', $data['user_id'])->first();
  208. $withdrawId = Db::table('wa_withdraw')->insertGetId([
  209. 'order_no' => date('YmdHis') . mt_rand(10000, 99999),
  210. 'user_id' => $data['user_id'],
  211. 'money' => $data['withdraw_money'],
  212. 'type' => $data['mold_type'],
  213. 'affiliated_bank' => $bankCard->affiliated_bank,
  214. 'account_holder' => $bankCard->account_holder,
  215. 'card_number' => $bankCard->card_number,
  216. 'created_at' => date('Y-m-d H:i:s'),
  217. 'updated_at' => date('Y-m-d H:i:s'),
  218. ]);
  219. StreamBusiness::delStream($data['user_id'], $data['withdraw_money'], streamType4, $data['mold_type'], moldTypefild($data['mold_type']), $withdrawId);
  220. } catch (Throwable $exception) {
  221. throw new \Exception($exception->getMessage());
  222. }
  223. }
  224. /** 支付回调
  225. * @param $orderNo
  226. * @return void
  227. */
  228. static public function paymentCallback($orderNo)
  229. {
  230. try {
  231. $payorder = Db::table('wa_payorder')->where('order_no', $orderNo)->first();
  232. if ($payorder->is_pay != 1) {
  233. throw new \Exception('订单已处理!');
  234. }
  235. self::payorderSave(collect($payorder)->toArray());
  236. } catch (\Throwable $exception) {
  237. throw new \Exception($exception->getMessage());
  238. }
  239. return true;
  240. }
  241. /** 购买原始股权回调
  242. * @param $data
  243. * @return void
  244. */
  245. // static public function goodsStockRights($data)
  246. // {
  247. // try {
  248. // $goodsData=Db::table('wa_goods')->where('id',$data['goods_id'])->first();
  249. // $thisDay=date('Y-m-d H:i:s');
  250. // /** @var $futureDay 未来时间*/
  251. // $futureDay=futureDay(1095);
  252. //
  253. // $myGoodsId=Db::table('wa_my_goods')->insertGetId([
  254. // 'user_id' => $data['user_id'],
  255. // 'goods_id' => $goodsData->id,
  256. // 'money' => $data['money'],
  257. // 'on' => date('YmdHis').mt_rand(1000,9999),
  258. // 'type' => $goodsData->type,
  259. // 'pay_id' => $data['id'],
  260. // 'stock_rights' => $goodsData->stock_rights,
  261. // 'unit_price' => $goodsData->unit_price,
  262. // 'refund_amount' => $data['money'],
  263. // 'expiretime' => strtotime($futureDay),
  264. // 'expiredate' => $futureDay,
  265. // 'created_at' => $thisDay,
  266. // 'updated_at' => $thisDay
  267. // ]);
  268. //
  269. //
  270. //// StreamBusiness::addStream($data['user_id'],bcmul($goodsData->stock_rights,$goodsData->unit_price,2),streamType5,moldType4,moldTypefild(moldType4),$data['id']);
  271. //
  272. // $usersData=Db::table('wa_users')->where('id',$data['user_id'])->first();
  273. // $system=Db::table('wa_system')->first();
  274. // if(!empty($usersData->pid) && !empty($system->rebate)){
  275. // StreamBusiness::addStream($usersData->pid,$system->rebate,streamType10,moldType4,moldTypefild4,$data['id']);
  276. // }
  277. // if(!empty($usersData->ppid) && !empty($system->rebate_one)){
  278. // StreamBusiness::addStream($usersData->ppid,$system->rebate_one,streamType10,moldType4,moldTypefild4,$data['id']);
  279. // }
  280. //
  281. // if(!empty($usersData->toppid) && !empty($system->rebate_two)){
  282. // StreamBusiness::addStream($usersData->toppid,$system->rebate_two,streamType10,moldType4,moldTypefild4,$data['id']);
  283. // }
  284. //
  285. // /** 新增消费数据 */
  286. // Db::table('wa_users')->where('id',$data['user_id'])->increment('invest_money',$data['money']);
  287. //
  288. // Db::table('wa_goods')->where('id',$goodsData->id)->decrement('num',1);
  289. //
  290. // }catch (\Throwable $exception){
  291. // throw new \Exception($exception->getMessage());
  292. // }
  293. // }
  294. /** 订单回调处理
  295. * @param $data 订单信息
  296. * @return void
  297. */
  298. static public function payorderSave($data)
  299. {
  300. try {
  301. self::payorderGoods($data);
  302. Db::table('wa_payorder')->where('id', $data['id'])->update([
  303. 'is_pay' => 2,
  304. 'updated_at' => date('Y-m-d H:i:s'),
  305. ]);
  306. } catch (\Throwable $exception) {
  307. throw new \Exception($exception->getMessage());
  308. }
  309. return true;
  310. }
  311. /** 商品回调
  312. * @param $data
  313. * @return void
  314. * @throws \Exception
  315. */
  316. static public function payorderGoods($data)
  317. {
  318. try {
  319. $goodsData = Db::table('wa_goods')->where('id', $data['goods_id'])->first();
  320. $thisDay = date('Y-m-d H:i:s');
  321. /** @var $futureDay 未来时间 */
  322. $futureDay = futureDay(1095);
  323. $myGoodsId = Db::table('wa_my_goods')->insertGetId([
  324. 'user_id' => $data['user_id'],
  325. 'goods_id' => $goodsData->id,
  326. 'money' => $data['money'],
  327. 'num' => $data['num'],
  328. 'on' => date('YmdHis') . mt_rand(1000, 9999),
  329. 'type' => $goodsData->type,
  330. 'pay_id' => $data['id'],
  331. 'bonus' => $goodsData->bonus,
  332. 'refund_amount' => $data['money'],
  333. 'name' => Arr::get($data, 'name', null),
  334. 'mobile' => Arr::get($data, 'mobile', null),
  335. 'number' => Arr::get($data, 'number', null),
  336. 'address' => Arr::get($data, 'address', null),
  337. 'reservation_name' => Arr::get($data, 'reservation_name', null),
  338. 'reservation_mobile' => Arr::get($data, 'reservation_mobile', null),
  339. 'reservation_address' => Arr::get($data, 'reservation_address', null),
  340. 'account_number' => Arr::get($data, 'account_number', null),
  341. 'reservation_status' => 1,
  342. 'expiretime' => strtotime($futureDay),
  343. 'expiredate' => $futureDay,
  344. 'created_at' => $thisDay,
  345. 'updated_at' => $thisDay,
  346. ]);
  347. $userlist = Db::table('wa_users')->where('id', $data['user_id'])->first();
  348. // if (!empty($goodsData->bonus)) {
  349. // Db::table('wa_cron_task')->insert([
  350. // 'user_id' => $data['user_id'],
  351. // 'goods_id' => $goodsData->id,
  352. // 'order_id' => $data['id'],
  353. // 'money' => $data['money'],
  354. // 'bonus' => $goodsData->bonus,
  355. // 'goods_type' => $goodsData->type,
  356. // 'day_dividend_time' => strtotime(date('Y-m-d', strtotime('+1 days')) . ' 00:00:00'),
  357. // 'dividend_time' => strtotime($futureDay),
  358. // 'created_at' => $thisDay,
  359. // 'updated_at' => $thisDay,
  360. // 'my_good_id' => $myGoodsId,
  361. // ]);
  362. // StreamBusiness::addStream($data['user_id'], $goodsData->bonus, streamType9, moldType5, moldTypefild5, $data['id']);
  363. // }
  364. // if (!empty($goodsData->balance)) {
  365. // StreamBusiness::addStream($data['user_id'], $goodsData->balance, streamType9, moldType3, moldTypefild3, $data['id']);
  366. // }
  367. $user = Db::table('wa_users')->where('id', $data['user_id'])->first();
  368. $system = Db::table('wa_system')->first();
  369. if ($goodsData->type == 1) {
  370. $card_num = generateBankAccountNumber();
  371. Db::table('wa_user_social_cark')->insert([
  372. 'type' => 1,
  373. 'user_id' => $data['user_id'],
  374. 'card_num' => $card_num,
  375. 'password' => $userlist->password,
  376. 'name' => Arr::get($data, 'name', null),
  377. 'mobile' => Arr::get($data, 'mobile', null),
  378. 'number' => Arr::get($data, 'number', null),
  379. 'address' => Arr::get($data, 'address', null),
  380. 'created_at' => date('Y-m-d H:i:s'),
  381. 'updated_at' => date('Y-m-d H:i:s'),
  382. 'addtime' => time(),
  383. ]);
  384. Db::table('wa_users')->where('id', $data['user_id'])->update(['card_code' => $card_num]);
  385. } elseif ($goodsData->type == 2) {
  386. StreamBusiness::addStream($data['user_id'], $data['money'], streamType14, moldType4, moldTypefild4, $data['id']);
  387. } elseif ($goodsData->type == 3) {
  388. if (!empty($goodsData->balance)) {
  389. StreamBusiness::addStream($data['user_id'], $goodsData->balance, streamType9, moldType2, moldTypefild2, $data['id']);
  390. }
  391. Db::table('wa_user_social_cark')->where('user_id', $data['user_id'])->where('type', 1)->increment('daily_limit', $goodsData->daily_limit);
  392. Db::table('wa_user_social_cark')->where('user_id', $data['user_id'])->where('type', 1)->increment('monthly_limit', $goodsData->monthly_limit);
  393. Db::table('wa_user_social_cark')->where('user_id', $data['user_id'])->where('type', 1)->increment('safety_gold', $goodsData->safety_gold);
  394. $cardlist = Db::table('wa_user_social_cark')
  395. ->where('user_id', $data['user_id'])
  396. ->where('type', 1)
  397. ->first();
  398. if (!empty($cardlist)) {
  399. if ($cardlist->goods_id < $goodsData->id) {
  400. Db::table('wa_user_social_cark')->where('id', $cardlist->id)->update([
  401. 'goods_id' => $goodsData->id,
  402. 'goods_img' => $goodsData->img,
  403. ]);
  404. }
  405. }
  406. } elseif ($goodsData->type == 4) {
  407. Db::table('wa_users')->where('id', $data['user_id'])->update(['signature_time' => date('Y-m-d H:i:s')]);
  408. } elseif ($goodsData->type == 5) {
  409. } elseif ($goodsData->type == 6) {
  410. Db::table('wa_user_social_cark')
  411. ->where('user_id', $data['user_id'])
  412. ->where('type', 1)
  413. ->update([
  414. 'binding_mobile' => $data['binding_mobile'],
  415. ]);
  416. } elseif ($goodsData->type == 7) {
  417. } elseif ($goodsData->type == 8) {
  418. } elseif ($goodsData->type == 9) {
  419. } elseif ($goodsData->type == 10) {
  420. Db::table('wa_users')->where('id', $data['user_id'])->increment('total_withdrawal_amount', $goodsData->balance);
  421. }elseif ($goodsData->type == 11) {
  422. }elseif ($goodsData->type == 12) {
  423. }elseif ($goodsData->type == 14) {
  424. }elseif ($goodsData->type == 15) {
  425. }elseif ($goodsData->type == 16) {
  426. }elseif ($goodsData->type == 17) {
  427. }elseif ($goodsData->type == 18) {
  428. if (!empty($goodsData->balance)) {
  429. StreamBusiness::addStream($data['user_id'], $goodsData->balance, streamType19, moldType6, moldTypefild6, $data['id']);
  430. }
  431. }elseif ($goodsData->type == 19) {
  432. }elseif ($goodsData->type == 20) {
  433. }elseif ($goodsData->type == 21) {
  434. Db::table('wa_users')->where('id', $data['user_id'])->update(['vip_name'=>$goodsData->name,'vip_img'=>$goodsData->img]);
  435. }elseif ($goodsData->type == 22) {
  436. }elseif ($goodsData->type == 23) {
  437. }elseif ($goodsData->type == 24) {
  438. }elseif ($goodsData->type == 25) {
  439. }elseif ($goodsData->type == 26) {
  440. }
  441. if (!empty($user->pid) && !empty($system->rebate)) {
  442. StreamBusiness::addStream($user->pid, bcmul($data['money'], bcdiv($system->rebate, 100, 2), 2), streamType10, moldType3, moldTypefild3, $data['id']);
  443. }
  444. if (!empty($user->ppid) && !empty($system->rebate_one)) {
  445. StreamBusiness::addStream($user->ppid, bcmul($data['money'], bcdiv($system->rebate_one, 100, 2), 2), streamType10, moldType3, moldTypefild3, $data['id']);
  446. }
  447. if (!empty($user->toppid) && !empty($system->rebate_two)) {
  448. StreamBusiness::addStream($user->toppid, bcmul($data['money'], bcdiv($system->rebate_two, 100, 2), 2), streamType10, moldType3, moldTypefild3, $data['id']);
  449. }
  450. /** 新增消费数据 */
  451. Db::table('wa_users')->where('id', $data['user_id'])->increment('invest_money', $data['money']);
  452. Db::table('wa_goods')->where('id', $goodsData->id)->decrement('num', $data['num']);
  453. /** 分佣 */
  454. } catch (\Throwable $exception) {
  455. throw new \Exception($exception->getMessage());
  456. }
  457. }
  458. /** 国债订单回调处理
  459. * @param $data 订单信息
  460. * @return void
  461. */
  462. static public function CardpayorderSave($data)
  463. {
  464. try {
  465. $goodsData = Db::table('wa_goods')->where('id', $data['goods_id'])->first();
  466. $thisDay = date('Y-m-d H:i:s');
  467. /** @var $futureDay 未来时间 */
  468. $futureDay = futureDay(1095);
  469. $myGoodsId = Db::table('wa_my_goods')->insertGetId([
  470. 'user_id' => $data['user_id'],
  471. 'goods_id' => $goodsData->id,
  472. 'money' => $data['money'],
  473. 'num' => $data['num'],
  474. 'on' => date('YmdHis') . mt_rand(1000, 9999),
  475. 'type' => $goodsData->type,
  476. 'pay_id' => $data['id'],
  477. 'bonus' => $goodsData->bonus,
  478. 'refund_amount' => $data['money'],
  479. 'expiretime' => strtotime($futureDay),
  480. 'expiredate' => $futureDay,
  481. 'created_at' => $thisDay,
  482. 'updated_at' => $thisDay,
  483. ]);
  484. if (!empty($goodsData->bonus)) {
  485. Db::table('wa_cron_task')->insert([
  486. 'user_id' => $data['user_id'],
  487. 'goods_id' => $goodsData->id,
  488. 'order_id' => $data['id'],
  489. 'money' => $data['money'],
  490. 'bonus' => $goodsData->bonus,
  491. 'goods_type' => $goodsData->type,
  492. 'day_dividend_time' => strtotime(date('Y-m-d', strtotime('+1 days')) . ' 00:10:00'),
  493. 'dividend_time' => strtotime($futureDay),
  494. 'created_at' => $thisDay,
  495. 'updated_at' => $thisDay,
  496. 'my_good_id' => $myGoodsId,
  497. ]);
  498. StreamBusiness::addStream($data['user_id'], $goodsData->bonus, streamType14, moldType1, moldTypefild1, $data['id']);
  499. }
  500. StreamBusiness::delStream($data['user_id'], $data['money'], streamType17, moldType2, moldTypefild2, $data['id']);
  501. Db::table('wa_goods')->where('id', $goodsData->id)->decrement('num', $data['num']);
  502. } catch (\Throwable $exception) {
  503. throw new \Exception($exception->getMessage());
  504. }
  505. }
  506. }