getMessage(), 500); } } /** * Notes:修改角色 * @param array $param * @return int * User: QJF * Date: 2022/9/19 */ public static function updatePackageGoods($param) { SystemRole::affairBegin(); try { $where = []; $where['goods_id'] = $param['goods_id']; $param['goods_update_time'] = time(); $result = PackageGoods::where($where)->update($param); if ($result !== false){ SystemRole::affairCommit(); return true; } throw new \Exception('操作失败!'); }catch (\Exception $exception){ SystemRole::affairRollback(); throw new \Exception($exception->getMessage(), 500); } } /** * Notes:任务 * @param int $role_id * @return int * User: QJF * Date: 2022/9/19 */ public static function delPackageGoods($goods_id,$goods_status) { SystemRole::affairBegin(); try { $where = []; $where['goods_id'] = $goods_id; $data['goods_status'] = $goods_status; $data['goods_update_time'] = time(); $result = PackageGoods::where($where)->update($data); if (!empty($result)){ SystemRole::affairCommit(); return true; }else{ return false; } }catch (\Exception $exception){ SystemRole::affairRollback(); throw new \Exception($exception->getMessage(), 500); } } /** * Notes:获取权益包详情 * @param int $package_id * @return int * User: QJF * Date: 2022/9/19 */ public static function infoPackage($goods_id) { SystemRole::affairBegin(); try { $where = []; $where['goods_id'] = $goods_id; $result = PackageGoods::where($where)->first(); if (!empty($result)){ SystemRole::affairCommit(); return $result; }else{ return false; } }catch (\Exception $exception){ SystemRole::affairRollback(); throw new \Exception($exception->getMessage(), 500); } } }