| | |
| | | use app\api\model\user\CardRecord as CardRecordModel; // 会员卡 by lyzflash |
| | | use app\common\model\plus\advance\Product as AdvanceProductModel; |
| | | use app\supplier\model\product\ProductSku; |
| | | |
| | | use app\api\model\order\Cart as CartModel; |
| | | /** |
| | | * 商品模型 |
| | | */ |
| | |
| | | private function setProductListDataFromApi(&$data, $isMultiple, $param) |
| | | { |
| | | return parent::setProductListData($data, $isMultiple, function ($product) use ($param) { |
| | | if(!empty($param['userInfo'])){ |
| | | $CartModel=new CartModel(); |
| | | $product['cart']=$CartModel->getCartCount($param['userInfo']['user_id'],$product['product_id']); |
| | | }else{ |
| | | $product['cart']=['total_num'=>0]; |
| | | } |
| | | |
| | | // 计算并设置商品会员价 |
| | | $this->setProductGradeMoney($param['userInfo'], $product); |
| | | }); |
| | |
| | | /** |
| | | * 编辑商品 |
| | | */ |
| | | public function edit($data,$shop_supplier_id) |
| | | public function edit($data) |
| | | { |
| | | if (!isset($data['image']) || empty($data['image'])) { |
| | | $this->error = '请上传商品图片'; |