user_id = $data['user_id']; $this->type = $data['type']; $this->trade_no = $data['trade_no']; $this->amount = $data['amount']; $this->send_name = $data['send_name']; $this->packet_type = $data['packet_type']; $this->openid = $data['openid']; } /** * Execute the job. * * @return void */ public function handle() { // RedPacketOrder::create([ // 'user_id'=>$this->user_id, // 'type'=>$this->type, // 'trade_no'=>$this->trade_no, // 'amount'=>$this->amount, // ]); $total_amount = $this->amount * 100; // $wish = '福恋一家,有你,有我、有祂!'; if ($this->packet_type == 'normal') { // $result = \WechatService::sendNormalRedPack($this->trade_no, $this->send_name, $total_amount, $this->openid, $wish, $this->send_name); // $result = \WechatService::userTransfer($this->trade_no, $this->openid, $total_amount, $this->send_name); } } }