本文整理汇总了PHP中app\Order::item方法的典型用法代码示例。如果您正苦于以下问题:PHP Order::item方法的具体用法?PHP Order::item怎么用?PHP Order::item使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Order
的用法示例。
在下文中一共展示了Order::item方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTakeorder
public function getTakeorder(Request $request, $shop_id, $offer_id, $product_amount)
{
$user = $request->user();
$business = Business::apiFind($shop_id);
$offer = Offer::apiFind($shop_id, $offer_id);
$coupon_id = $request->input('coupon_id');
$item = Order::item($offer_id, $product_amount);
$check = Offer::apiCheck($item, $shop_id, $coupon_id);
$mobile = $request->input('mobile');
$touch = $request->input('touch');
$sex = $request->input('sex');
$url = '/business/takeorder/' . $shop_id . '/' . $offer_id . '/' . $product_amount . '?mobile=' . $mobile . '&touch=' . $touch . '&sex=' . $sex;
session(['url' => $url]);
return view('auth.business.takeorder', ['TITLE' => '下单', 'META_KEYWORDS' => META_KEYWORDS, 'META_DESC' => META_DESC, 'PAGE_CODE' => 'auth.business.takeorder', 'user' => $user, 'business' => $business, 'offer' => $offer, 'check' => $check, 'product_amount' => $product_amount, 'mobile' => $mobile, 'touch' => $touch, 'sex' => $sex, 'coupon_id' => $coupon_id, 'url' => $url]);
}
示例2: getTakeorder
public function getTakeorder(Request $request, $staffer_id, $tote_id, $product_amount)
{
$user = $request->user();
$abd_id = $request->input('abd_id');
$days = $request->input('days');
$moment = $request->input('moment');
$time = $request->input('time');
$coupon_id = $request->input('coupon_id');
$staffer = Staffer::apiFind($staffer_id);
$address = Address::apiFind($abd_id);
$item = Order::item($tote_id, $product_amount);
$check = Tote::apiCheck($item, $staffer_id, $abd_id, $days, $moment, $coupon_id);
$tote = Tote::apiFind($tote_id);
$url = URL::full();
session(['url' => $url]);
return view('auth.staffer.takeorder', ['TITLE' => '下单', 'META_KEYWORDS' => META_KEYWORDS, 'META_DESC' => META_DESC, 'PAGE_CODE' => 'auth.staffer.takeorder', 'user' => $user, 'staffer' => $staffer, 'address' => $address, 'check' => $check, 'tote' => $tote, 'staffer_id' => $staffer_id, 'tote_id' => $tote_id, 'product_amount' => $product_amount, 'abd_id' => $abd_id, 'days' => $days, 'moment' => $moment, 'time' => $time, 'coupon_id' => $coupon_id, 'url' => $url]);
}
示例3: postAddoffer
public function postAddoffer(request $request)
{
$user = $request->user();
$offer_id = $request->input('offer_id');
$product_amount = $request->input('product_amount');
$item = Order::item($offer_id, $product_amount);
$shop_id = $request->input('shop_id');
$coupon_id = $request->input('coupon_id');
$mobile = $request->input('mobile');
$touch = $request->input('touch');
$sex = $request->input('sex');
$url = $request->input('url');
$response = Offer::apiCheck($item, $shop_id, $coupon_id);
if ($response) {
$params = ['item_id' => $shop_id, 'item' => $item, 'mobile' => $mobile, 'touch' => $touch, 'sex' => $sex];
if ($coupon_id) {
$params['coupon_id'] = $coupon_id;
}
$order = Order::apiCreateZd($params);
if (is_object($order)) {
$business = new Business(env('WECHAT_APPID'), env('WECHAT_APPSECRET'), env('WECHAT_MCHID'), env('WECHAT_KEY'));
$wxorder = new WxOrder();
$wxorder->body = $order->odrno;
$wxorder->out_trade_no = $order->odrno;
$wxorder->total_fee = $order->final * 100;
// 单位为 “分”, 字符串类型
$wxorder->openid = $user->user_open_id;
$wxorder->notify_url = API_PAY_CALLBACK_URL;
$unifiedOrder = new UnifiedOrder($business, $wxorder);
$payment = new Payment($unifiedOrder);
$res = redirect('/pay')->with(['payment' => $payment, 'order' => $order, 'wxorder' => $wxorder, 'url' => $url, 'type' => 'ZD']);
} else {
$res = redirect()->back()->with('msgError', $order);
}
} else {
$res = redirect()->back()->with('msgError', '订单信息错误');
}
return $res;
}
示例4: apiAbodeMomentGet
public static function apiAbodeMomentGet($tote_id, $qt, $staffer_id, $range = '4')
{
$client = new Client();
$apiUri = '/v1/tote/abode_moment.json';
$user = new User();
$item = Order::item($tote_id, $qt);
$params = ['item' => $item, 'staffer_id' => $staffer_id, 'range' => $range];
$request = $client->post(API_URL . $apiUri, ['form_params' => $params, 'headers' => User::headers($apiUri)]);
if ($request->getStatusCode() == '200') {
$response = json_decode($request->getBody());
if (isset($response->success) && !$response->success) {
$res = '';
} else {
$res = $response;
}
} else {
$res = '';
}
return $res;
}