getMessage(), 500); } } /** * Notes:修改产品 * @param array $param * @return int * User: QJF * Date: 2022/9/23 */ public static function updateShop($param) { MerchantShop::affairBegin(); try { $where = []; $where['shop_id'] = $param['shop_id']; $param['shop_update_time'] = time(); $result = MerchantShop::where($where)->update($param); if ($result !== false){ MerchantShop::affairCommit(); return true; } throw new \Exception('操作失败!'); }catch (\Exception $exception){ MerchantShop::affairRollback(); throw new \Exception($exception->getMessage(), 500); } } /** * Notes:删除产品 * @param int $role_id * @return int * User: QJF * Date: 2022/9/23 */ public static function delShop($shop_id) { MerchantShop::affairBegin(); try { $where = []; $where['shop_id'] = $shop_id; $data['shop_del'] = 1; $data['shop_update_time'] = time(); $result = MerchantShop::where($where)->update($data); if (!empty($result)){ MerchantShop::affairCommit(); return true; }else{ return false; } }catch (\Exception $exception){ MerchantShop::affairRollback(); throw new \Exception($exception->getMessage(), 500); } } /** * Notes:上/下架 * @param int $role_id * @return int * User: QJF * Date: 2022/9/28 */ public static function showShop($shop_id,$product_status) { MerchantShop::affairBegin(); try { $where = []; $where['shop_id'] = $shop_id; $data['shop_status'] = $product_status; $data['shop_update_time'] = time(); $result = MerchantShop::where($where)->update($data); if (!empty($result)){ MerchantShop::affairCommit(); return true; }else{ return false; } }catch (\Exception $exception){ MerchantShop::affairRollback(); throw new \Exception($exception->getMessage(), 500); } } /** * Notes:产品详情 * @param int $package_id * @return int * User: QJF * Date: 2022/9/23 */ public static function infoShop($shop_id) { MerchantShop::affairBegin(); try { $where = []; $where['shop_id'] = $shop_id; $result = MerchantShop::where($where)->first(); if (!empty($result)){ MerchantShop::affairCommit(); return $result; }else{ return false; } }catch (\Exception $exception){ MerchantShop::affairRollback(); throw new \Exception($exception->getMessage(), 500); } } }