public function show($id) { $curr['name'] = $this->crumb['show']['name']; $curr['url'] = $this->crumb['show']['url']; $result = ['data' => StoryBoardModel::find($id), 'model' => $this->model, 'crumb' => $this->crumb, 'curr' => $curr]; return view('admin.storyboard.show', $result); }
public function show($id) { $curr['name'] = $this->lists['show']['name']; $curr['url'] = $this->lists['show']['url']; $result = ['data' => StoryBoardModel::find($id), 'model' => $this->model, 'lists' => $this->lists, 'curr' => $curr]; return view('member.storyboard.show', $result); }
public function show($id) { if (!\Session::has('user.uid')) { return redirect('/login'); } $data = StoryBoardModel::find($id); //内容查看权限开关 if ($data->genre == 1) { //供应分镜 $orderModel = OrderModel::where('genre', 3)->where('buyer', $this->userid)->where('status', '>', 11)->where('isshow', 1)->where('del', 0)->first(); } elseif ($data->genre == 2) { //需求分镜 $orderModel = OrderModel::where('genre', 4)->where('seller', $this->userid)->where('status', '>', 11)->where('isshow', 1)->where('del', 0)->first(); } $data->iscon = 0; if (isset($orderModel) && $orderModel) { if ($orderModel->status < 12) { $data->iscon = 1; } elseif ($orderModel->status == 13) { $data->iscon = 2; } elseif ($orderModel->status == 12) { $data->iscon = 3; } $data->remarks = $orderModel->remarks; } $result = ['data' => $data, 'lists' => $this->list, 'curr_menu' => $this->curr, 'uid' => $this->userid]; return view('home.storyboard.show', $result); }
/** * 订单来源的数据 */ public function getModel() { if (in_array($this->genre, [1, 2])) { $model = IdeasModel::find($this->fromid); } elseif (in_array($this->genre, [3, 4])) { $model = StoryBoardModel::find($this->fromid); } elseif (in_array($this->genre, [5, 6])) { $model = GoodsModel::find($this->fromid); } return isset($model) ? $model : ''; }
/** * 前台下的订单,这里统一处理 */ public function create() { if (AjaxRequest::ajax()) { $data = Input::all(); //假如已有类似订单 $order = OrderModel::where(['genre' => $data['genre'], 'fromid' => $data['id']])->first(); if (count($order)) { echo json_encode(array('code' => '-2', 'message' => '你已经申请此订单,不能重复申请!')); exit; } //1创意供应,2创意需求,3分镜供应,4分镜需求,5视频供应,6视频需求,7娱乐供应,8娱乐需求,9演员供应,10演员需求,1租赁供应,12租赁需求 if (in_array($data['genre'], [1, 2])) { $ideaModel = \App\Models\IdeasModel::find($data['id']); $productname = $ideaModel->name; $sellerid = $ideaModel->uid; } elseif (in_array($data['genre'], [3, 4])) { $storyBoardModel = \App\Models\StoryBoardModel::find($data['id']); $productname = $storyBoardModel->name; $sellerid = $storyBoardModel->uid; } elseif (in_array($data['genre'], [5, 6])) { $videoModel = \App\Models\Base\VideoModel::find($data['id']); $productname = $videoModel->name; $sellerid = $videoModel->uid; } //获取供应方信息 $userModel = UserModel::find($sellerid); //插入订单表 $order = ['name' => $productname, 'serial' => date('YmdHis', time()) . rand(0, 10000), 'genre' => $data['genre'], 'fromid' => $data['id'], 'seller' => $sellerid, 'sellerName' => $userModel->username, 'buyer' => $this->userid, 'buyerName' => \Session::get('user.username'), 'status' => 1, 'created_at' => time()]; OrderModel::create($order); //插入支付表 $orderModel = OrderModel::where($order)->first(); $pay = ['genre' => 1, 'order_id' => $orderModel->id, 'created_at' => time()]; PayModel::create($pay); echo json_encode(array('code' => '0', 'message' => '操作成功!')); exit; } echo json_encode(array('code' => '-1', 'message' => '非法操作!')); exit; }