|
@@ -22,7 +22,8 @@ class ProductStock extends Base
|
|
|
}
|
|
|
|
|
|
public function getCombindStockAttr($value,$data){
|
|
|
- if($data['is_combind']==1){
|
|
|
+ $isCombind=FinancialProducts::where('id',$data['product_id'])->value('is_combind');
|
|
|
+ if($isCombind==1){
|
|
|
$combind_stock=ProductsCombind::with(['ProductStock'])->where('parent_id',$data['product_id'])->select();
|
|
|
$num=0;
|
|
|
$combind_stock->each(function ($item,$key) use ($num){
|