|
@@ -47,8 +47,8 @@ class BoxHookService extends Service
|
|
|
list($status,$box) = $this->dealBox($box,$data);
|
|
|
if(!$status) return [false,$box];
|
|
|
$box->save();
|
|
|
- list($status,$box) = $this->boxDetailInsert($data);
|
|
|
- if(!$status) return [false,$box];
|
|
|
+ list($status,$msg) = $this->boxDetailInsert($data);
|
|
|
+ if(!$status) return [false,$msg];
|
|
|
|
|
|
return [true,$box];
|
|
|
}
|
|
@@ -101,12 +101,12 @@ class BoxHookService extends Service
|
|
|
* @return array
|
|
|
*/
|
|
|
public function dealBoxDetail($data,$order_no,$out_order_no){
|
|
|
-
|
|
|
$insert = [];
|
|
|
+ $time = time();
|
|
|
foreach ($data as $v){
|
|
|
- if(!isset($data['top_id'])) return [false,'top_id is not exist'];
|
|
|
- if(!isset($data['code'])) return [false,'code is not exist'];
|
|
|
- if(!isset($data['title'])) return [false,'title is not exist'];
|
|
|
+ if(!isset($v['top_id'])) return [false,'top_id is not exist'];
|
|
|
+ if(!isset($v['code'])) return [false,'code is not exist'];
|
|
|
+ if(!isset($v['title'])) return [false,'title is not exist'];
|
|
|
|
|
|
$insert[] = [
|
|
|
'order_no' => $order_no,
|
|
@@ -114,11 +114,14 @@ class BoxHookService extends Service
|
|
|
'top_id' => $v['top_id'],
|
|
|
'code' => $v['code'],
|
|
|
'title' => $v['title'],
|
|
|
- 'ext_1' => isset($data['ext_1']) ? $data['ext_1'] : '',
|
|
|
- 'ext_2' => isset($data['ext_2']) ? $data['ext_2'] : '',
|
|
|
- 'ext_3' => isset($data['ext_3']) ? $data['ext_3'] : '',
|
|
|
- 'ext_4' => isset($data['ext_4']) ? $data['ext_4'] : '',
|
|
|
- 'ext_5' => isset($data['ext_5']) ? $data['ext_5'] : '',
|
|
|
+ 'type' => isset($v['type'])?$v['type'] : 1,
|
|
|
+ 'crt_time' => $time,
|
|
|
+ 'upd_time' => $time,
|
|
|
+ 'ext_1' => isset($v['ext_1']) ? $v['ext_1'] : '',
|
|
|
+ 'ext_2' => isset($v['ext_2']) ? $v['ext_2'] : '',
|
|
|
+ 'ext_3' => isset($v['ext_3']) ? $v['ext_3'] : '',
|
|
|
+ 'ext_4' => isset($v['ext_4']) ? $v['ext_4'] : '',
|
|
|
+ 'ext_5' => isset($v['ext_5']) ? $v['ext_5'] : '',
|
|
|
|
|
|
];
|
|
|
}
|
|
@@ -136,6 +139,31 @@ class BoxHookService extends Service
|
|
|
return date('YmdHis').rand(1000,9999);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @param $data
|
|
|
+ * @return array
|
|
|
+ */
|
|
|
+ public function boxList($data){
|
|
|
+ $box = new Box();
|
|
|
+ $list = $this->limit($box,'*',$data);
|
|
|
+
|
|
|
+ return [true,$list];
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ public function boxDetail($data){
|
|
|
+ $order_no = $data['order_no'];
|
|
|
+
|
|
|
+ $box = new BoxDetail(['channel'=>$order_no]);
|
|
|
+
|
|
|
+ $list = $this->limit($box,'*',$data);
|
|
|
+
|
|
|
+ return [true,$list];
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
}
|