...
|
...
|
@@ -276,12 +276,35 @@ class AdminOrderController extends AdminBaseController |
|
|
->field('m.id as user_id,m.name,m.tel,o.order_sn,o.hire_id,o.id')
|
|
|
->find();
|
|
|
if($this->request->isPost()){
|
|
|
Db::startTrans();
|
|
|
$where_resume['user_id'] = $data['type'];
|
|
|
$where_resume['status'] = 3;
|
|
|
$resume = Db::name('Resume')->where($where_resume)->value('id');
|
|
|
if(!$resume){
|
|
|
Db::rollback();
|
|
|
$this->error('分配失败');
|
|
|
}else{
|
|
|
// 更改订单表状态,若为10->6
|
|
|
$where_order['status'] = array('neq',9);
|
|
|
$where_order['id'] = $data['id'];
|
|
|
$up_order['status'] = 6;
|
|
|
$up_order['update_time'] = time();
|
|
|
$res_order = Db::name('Order')->where($where_order)->update($up_order);
|
|
|
if(!$res_order){
|
|
|
Db::rollback();
|
|
|
$this->error('分配失败');
|
|
|
}
|
|
|
// 更改雇人表状态
|
|
|
$where_hire['status'] = array('neq',9);
|
|
|
$where_hire['id'] = $coo_list['hire_id'];
|
|
|
$up_order['status'] = 6;
|
|
|
$up_order['update_time'] = time();
|
|
|
$res_hire = Db::name('Hire')->where($where_hire)->update($up_order);
|
|
|
if(!$res_hire){
|
|
|
Db::rollback();
|
|
|
$this->error('分配失败');
|
|
|
}
|
|
|
|
|
|
$addLog['order_id'] = $data['id'];
|
|
|
$addLog['hire_id'] = $coo_list['hire_id'];
|
|
|
$addLog['resume_int'] = $resume;
|
...
|
...
|
@@ -291,8 +314,10 @@ class AdminOrderController extends AdminBaseController |
|
|
$addLog['update_time'] = time();
|
|
|
$res = Db::name('CompareLog')->insertGetId($addLog);
|
|
|
if($res){
|
|
|
Db::commit();
|
|
|
$this->success('分配成功',url('index'));
|
|
|
}else{
|
|
|
Db::rollback();
|
|
|
$this->error('分配失败');
|
|
|
}
|
|
|
}
|
...
|
...
|
|