家政小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

RewardController.php 624B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace App\Http\Controllers;
  3. use Illuminate\Http\Request;
  4. use App\Models\Reward;
  5. class RewardController extends Controller
  6. {
  7. public function reward(Request $request) {
  8. $wechat_id = $request->header("openid");
  9. if($wechat_id) {
  10. $price = env("REWARD");
  11. $order_type = "reward";
  12. $reward = new Reward;
  13. $reward->status = 0;
  14. $reward->price = $price;
  15. $reward->wechat_id = $wechat_id;
  16. $reward->save();
  17. return redirect()->action('PaymentController@buildOrder', [$reward->id, "reward"]);
  18. }
  19. }
  20. }