|
@@ -138,6 +138,10 @@ class Orders extends Base {
|
|
|
if (!isset($data['to_user_id']) || empty($data['to_user_id'])) {
|
|
|
$this->error = '请选择执行人';
|
|
|
return false;
|
|
|
+// $sData['order_mode'] = 1;
|
|
|
+// $data['to_user_id'] = "";
|
|
|
+ }else{
|
|
|
+// $sData['order_mode'] = 4;
|
|
|
}
|
|
|
if ($data['work_type_mode'] == 1) {
|
|
|
if (!isset($data['type_id']) || empty($data['type_id'])) {
|
|
@@ -222,7 +226,26 @@ class Orders extends Base {
|
|
|
$conveyCate = Db::name('convey_cate')
|
|
|
->where('id', $data['type'])
|
|
|
->find();
|
|
|
- if($conveyCate['cate']==4){
|
|
|
+ if($conveyCate){ // 需求时间和应完成时间,都由前端传
|
|
|
+ if(!$data['xq_time'] || !$data['ywc_time']){
|
|
|
+ $data['xq_time'] = date('Y-m-d H:i:s');
|
|
|
+ $time = Db::name('time')
|
|
|
+ ->where('id',$conveyCate['time_id'])
|
|
|
+ ->find();
|
|
|
+ $data['ywc_time'] = date('Y-m-d H:i',strtotime($data['xq_time']) + 60*$time['bz_time']);
|
|
|
+ }else{
|
|
|
+ if ($data['xq_time'] >= $data['ywc_time']) {
|
|
|
+ $this->error = '应完成时间应大于需求时间';
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (strtotime($data['xq_time']) < time() - 10 * 60) {
|
|
|
+ $this->error = '需求时间已过时';
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /*if($conveyCate['cate']==4){
|
|
|
if (!$data['xq_time'] || !$data['ywc_time']) {
|
|
|
$this->error = '应完成时间应和需求时间不能为空';
|
|
|
return false;
|
|
@@ -241,7 +264,7 @@ class Orders extends Base {
|
|
|
->where('id',$conveyCate['time_id'])
|
|
|
->find();
|
|
|
$data['ywc_time'] = date('Y-m-d H:i',strtotime($data['xq_time']) + 60*$time['bz_time']);
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
|
|
|
$ysData = array(
|
|
@@ -311,7 +334,7 @@ class Orders extends Base {
|
|
|
$data['to_user_id'] = $data['user_id'];
|
|
|
}
|
|
|
$send_user_num = $this->sendUserNum($data['work_type_mode'],$data['org_id']);
|
|
|
- $users = explode(',', $data['to_user_id']);
|
|
|
+ $users = empty($data['to_user_id'])?[]:explode(',', $data['to_user_id']);
|
|
|
if($send_user_num==1 && count($users) >1){
|
|
|
exception('执行人只能选择单人');
|
|
|
}
|