|
@@ -172,18 +172,19 @@ class FinancialManager extends Base{
|
|
|
$id=$this->request->param("id",0,"intval");
|
|
|
$info=$this->model->with(['ProductRela'=>["product"],'FinancialTz'=>["ProductTz"]])->findOrEmpty($id);
|
|
|
if($info->isEmpty()) return error("数据不存在");
|
|
|
+ $ProductMap=[];
|
|
|
if($info['status']==3){
|
|
|
$map = $info->FinancialTz->ProductTz->toArray();
|
|
|
$ProductMap = array_map(function ($item){
|
|
|
if($item['type']==1) return $item['product_id'];
|
|
|
},$map);
|
|
|
- foreach ($info['ProductRela'] as $key=>$val){
|
|
|
- if(in_array($val['product_id'],$ProductMap)){
|
|
|
- $info['ProductRela'][$key]['is_check']=1;
|
|
|
- }else{
|
|
|
- $info['ProductRela'][$key]['is_check']=0;
|
|
|
- }
|
|
|
- }
|
|
|
+ }
|
|
|
+ foreach ($info['ProductRela'] as $key=>$val){
|
|
|
+ if(in_array($val['product_id'],$ProductMap)){
|
|
|
+ $info['ProductRela'][$key]['is_check']=1;
|
|
|
+ }else{
|
|
|
+ $info['ProductRela'][$key]['is_check']=0;
|
|
|
+ }
|
|
|
}
|
|
|
return success("获取成功",$info);
|
|
|
}
|