Exemplo n.º 1
0
 /**
  * 创作的渲染订单
  */
 public function getApply($productid, $renderMoney, $totalMoney)
 {
     if (!$productid || !$renderMoney || !$totalMoney) {
         echo "<script>alert('参数有误!');history.go(-1);</script>";
         exit;
     }
     $formats = array_flip($this->orderProModel['formatMoneys']);
     $serial = date('YmdHis', time()) . rand(0, 10000);
     $data = ['productid' => $productid, 'serial' => $serial, 'uid' => $this->userid, 'uname' => \Session::get('user.username'), 'format' => $formats[$renderMoney], 'created_at' => time()];
     OrderProductModel::create($data);
     $orderModel = OrderProductModel::where('serial', $serial)->first();
     $pay = ['genre' => 3, 'order_id' => $orderModel->id, 'money' => $totalMoney, 'created_at' => time()];
     PayModel::create($pay);
     return redirect(DOMAIN . 'online/u/order');
 }
Exemplo n.º 2
0
 /**
  * 插入创作订单表
  */
 public function addOrderPro($request, $genre, $proVideoModel)
 {
     $serial = date('YmdHis', time()) . rand(0, 10000);
     $formats = array_flip($this->orderProModel['formatMoneys']);
     $format = array_key_exists($request->formatMoney, $formats) ? $formats[$request->formatMoney] : 0;
     $time = time();
     $data = ['productid' => $proVideoModel->id, 'serial' => $serial, 'genre' => $genre, 'cate' => $proVideoModel->cate, 'uid' => $this->userid, 'uname' => \Session::get('user.username'), 'seller' => $proVideoModel->uid, 'format' => $format, 'record' => $request->intro, 'created_at' => $time];
     OrderProductModel::create($data);
     return OrderProductModel::where($data)->first();
 }