...
|
...
|
@@ -147,12 +147,9 @@ class IndexController extends CommentController |
|
|
}
|
|
|
$model = new HireModel();
|
|
|
$data['user_id'] = Session::get('uid');
|
|
|
echo "<pre/>";
|
|
|
print_r($data);
|
|
|
die;
|
|
|
$res = $model->save($data);
|
|
|
if($res){
|
|
|
$this->setOrder($model->id,$data['money']);
|
|
|
$this->setOrder($model->id,$data['money'],$data['user_id']);
|
|
|
$this->apiResponse('1','成功');
|
|
|
}else{
|
|
|
$this->apiResponse('0','提交失败');
|
...
|
...
|
@@ -186,11 +183,12 @@ class IndexController extends CommentController |
|
|
}
|
|
|
|
|
|
// 创建订单
|
|
|
public function setOrder($hireId,$money){
|
|
|
public function setOrder($hireId,$money,$user_id){
|
|
|
$orderModel = new OrderModel();
|
|
|
$add_order['order_sn'] = $this->getSn();
|
|
|
$add_order['hire_id'] = $hireId;
|
|
|
$add_order['money'] = $money;
|
|
|
$add_order['user_id'] = $user_id;
|
|
|
$res = $orderModel->save($add_order);
|
|
|
if(!$res){
|
|
|
$this->apiResponse('0','添加失败');
|
...
|
...
|
|