修改创建档案
This commit is contained in:
parent
b2869c5ed5
commit
7c264c1170
@ -16,7 +16,7 @@ class InformationController extends BaseApiController
|
|||||||
if ($res != true) {
|
if ($res != true) {
|
||||||
return $this->fail( BaseLogic::getError());
|
return $this->fail( BaseLogic::getError());
|
||||||
}
|
}
|
||||||
return $this->success('成功', $res->toArray());
|
return $this->success('ok', $res->toArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function add()
|
public function add()
|
||||||
|
@ -53,11 +53,14 @@ class UserInformationg extends BaseModel
|
|||||||
Db::startTrans();
|
Db::startTrans();
|
||||||
try{
|
try{
|
||||||
$result = self::create($data);
|
$result = self::create($data);
|
||||||
switch($param['data_type']){
|
foreach($param['datas'] as $k=>$v){
|
||||||
case 1:
|
self::informationg_demand($v,$result['id'],$param['admin_id']);
|
||||||
self::informationg_demand($param,$result['id']);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
// switch($param['data_type']){
|
||||||
|
// case 1:
|
||||||
|
// self::informationg_demand($param,$result['id']);
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
Db::commit();
|
Db::commit();
|
||||||
}catch(\Exception $e){
|
}catch(\Exception $e){
|
||||||
Db::rollback();
|
Db::rollback();
|
||||||
@ -67,10 +70,10 @@ class UserInformationg extends BaseModel
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function informationg_demand($param,$id){
|
public static function informationg_demand($param,$id,$admin_id){
|
||||||
|
|
||||||
$data=[
|
$data=[
|
||||||
'create_user_id'=>$param['admin_id'],
|
'create_user_id'=>$admin_id,
|
||||||
'category_id'=>$param['category_id']??0,
|
'category_id'=>$param['category_id']??0,
|
||||||
'category_child'=>$param['category_child']??0,
|
'category_child'=>$param['category_child']??0,
|
||||||
'data'=>json_encode($param['datas']),
|
'data'=>json_encode($param['datas']),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user